Re: SIGUSR1 function call?

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

 



Hi,

Sergey Semenov a écrit :

> Does it influence on perfomance as much? Please, explain your point of
> view. Thank you

I don't think it has an influence on performances, but simply it's not
the usual way of signaling an event to an userspace application.

> I've implemented driver, which waits for some event from external
> device. When this event comes, i should notify ASAP my user-space
> application from kernel to achieve the fastest reaction. Now i am
> using only signals and i don't know what i can do else. Can you advice
> me something ? Thank you!

If your application is waiting an event from a device, then it means
that it called something like read(), write() or ioctl() which are then
implemented in the kernel space driver. These functions can sleep in the
kernel space driver until the event occurs. Then, they are unblocked and
the userspace process can continue its execution.

For example, your shell (/bin/bash) calls read() on a /dev/tty, and is
blocked until an event occurs: here the event is the key press. It could
be the reception of a network packet, or anything else.

An other option is to go through the hotplug stuff (now called "uevent"
if didn't miss the thing), but this is more for events that don't occur
frequently, like device (un)plugging.

Can you describe more precisely what your driver is for, what is the
event, what does the application, etc. It's quite difficult to answer
such a general question.

Sincerly,

Thomas
-- 
Thomas Petazzoni
thomas.petazzoni@xxxxxxxx


--
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