* sigtimedwait timeout
[not found] <39CB844E.5ECBEA20@actionbase.se>
@ 2001-03-24 12:14 ` Henrik Nordstrom
0 siblings, 0 replies; only message in thread
From: Henrik Nordstrom @ 2001-03-24 12:14 UTC (permalink / raw)
To: Henrik Nordstrom; +Cc: linux-kernel
Noticed that my sigtimedwait timeout patch got into the kernel, so polled signal I/O should now
work much better.
The question on why the timeout is calculated with an +1 for non-zero timeouts is still open.
AFAICT is is not needed as timespec_to_jiffies() does a correct rounding. The effect now is
timeout sleeping
0 0
1ns 2 jiffies
1 jiffies 2 jiffies
2 jiffies 3 jiffies
3 jiffies 4 jiffies
...
If the "+1" is taken out then the timeout scale becomes the expected one, starting at 1 jiffie, not
2.
--
Henirk Nordstrom
Henrik Nordstrom wrote 22 September 2000:
> As I mentioned earlier sigtimedwait with a zero timeout (0,0) should not
> block, but it currently does for 10msec (one jiffie). This is a
> performance problem for applications using polled signal queues. SUSV2
> says specifically for this case "returns immediately with an error".
>
> Attached is a new version of my patch. The previous version messed up
> the signal mask if the signal queue was empty and a zero timeout was
> selected.
>
> It is still waiting one more jiffie than what is indicated by the
> timeout value if other than zero, caused by the following code fragment:
>
> timeout = (timespec_to_jiffies(&ts)
> + (ts.tv_sec || ts.tv_nsec));
>
> Does anyone have any clue on why this +1 is there? I think this should
> also go away to only read
>
> timeout = timespec_to_jiffies(&ts);
>
> --
> Henrik Nordstrom
[patch deleted]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-03-24 12:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <39CB844E.5ECBEA20@actionbase.se>
2001-03-24 12:14 ` sigtimedwait timeout Henrik Nordstrom
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.