lkml.org 
[lkml]   [2000]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sigtimedwait with a zero timeout
James Antill wrote:

> If you want to return imediatley (and there might not be data) the
> answer given is usually...
>
> sigqueue( ... );
> sigwaitinfo( ... );
>
> If the above will still schedule, then Linus might be more likely to
> take a patch (I'd guess that he'd look at sigtimedwait() to be like
> sleep() in most other cases though).

If you mean that I can work around the problem by forcing a pending
entry with a known tag and then poll with sigtimedwait/sigwaitinfo until
I see this tag then it is doable, but I don't see the good in in this
when
a) sigtimedwait is documented in at least SUSV2 to return immediately
with an error if the queue is emtpy and the timeout is zero
b) As shown it is quite easily patchable (a simple if, and a few lines
rearranged to fit the if)
c) It is pure overhead, while the patch is close to no overhead: one
added comparisation for the codepath when a timeout is selected, which
in the context is nothing.

--
Henrik Nordstrom

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

\
 
 \ /
  Last update: 2005-03-22 12:39    [W:0.043 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site