Re: Queue task

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Thank you for your reply. You answered to most of all my questions.
Additional RTFM is required for me :)

> But you said, you want to communicate right? that means passing a data,
> awaiting for certain kernel event, or something else?

Yes, abs. correct. I would like to modify ns2 simulator to get  an
opportunity to emualate real-world IP packets.
So, the ns2 application is a userspace application. Now my LLD is
looked like this: the ns2 simulator has a timetable with events. This
events should be executed at the certain time (as I already described
above).

There are two types of events:
1) Internal events of simulator
2) "Real events" - e.g. the new packet arriving to the interface. When
real-world IP packet arrives to the interface, my driver buffers it
and sends a signal to ns2 application. When ns2 application receives a
signal, it asks driver for new arrived packets IDs (via ioctl
function), generates event (internal) and schedule it for later
execution in a simulator.

Thus i can't use a block reading from /proc file because these
"virtual events" should be executed from time to time.

Also, this design distrubs me about perfomance. See:
When virtual event starts execution, I block all singnals (using
sigprocmask(SIG_BLOCK)) and release them after (using
sigprocmask(SIG_SETMASK)). I would like to protect my timetable
(scheduler) from multiply changes at the the same time (like Critical
sections).

In my test example simulator usually handles about 1800 events per
second. So i'm really aware of perfomance results.

So, the last question: Is there any possibility to make it faster? Can
anybody advice me more efficient ways?Are there some examples of such
kind communication between kernel and userspace?

Thank you!

Best regards,
Sergey Semionov

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux