Re: sigtimedwait with a zero timeout

From: Henrik Nordstrom (hno@hem.passagen.se)
Date: Mon Oct 02 2000 - 13:41:26 EST


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/



This archive was generated by hypermail 2b29 : Sat Oct 07 2000 - 21:00:10 EST