lkml.org 
[lkml]   [2005]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Registering for multiple SIGIO within a process
On 9/28/05, Ray Lee <ray-lk@madrabbit.org> wrote:
> On Wed, 2005-09-28 at 20:44 -0400, Bagalkote, Sreenivas wrote:
> > >(Sheesh, what is it with people thinking signals are something
> > >to be used in any design after the 1970's?)
> > What's your recommendation for asynchronous notification from driver
> > to an application?
>
> Pass back an fd to select() upon. Cuts out that nasty middle step where
> app authors end up registering a signal handler that merely write()s the
> signal number down a pipe into the (nearly ubiquitous) select loop.

If its just linux i would use asynchronous notification using RT
signals. You can use sigwaitinfo to check for the arrival of the
signal by blocking it. siginfo will contain the fd which receivd the
notification. That saves you the call to select as you would have to
select upto maxfd. If you are using just one fd poll would be a better
option IMHO.


Bharath
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-09-29 05:56    [W:0.039 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site