lkml.org 
[lkml]   [1999]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sleep_on, wake_up question
On Thu, 30 Dec 1999, Alan Cox wrote:

> Its luck on your part then. There is no provision in the system for handling
> that race using interruptible_sleep_on, because you can construct multiple
> correct solutions without having to hack the kernel up

In this case, what good is the sleep_on stuff? Wouldn't the cleaner
solution be to:
1) add an option to signal the wait queue in the wake_up function, if the
queue is empty (or perhaps even keep it signalled, even if there are
queued tasks).
2) for the sleep_on function, add an option to be immediately awoken if
entering an already signalled queue (and clear the signal).

This would hide all the ugliness, no? And prevent a lot of incorrect
drivers being written, just because some folks didn't catch on to this
race (e.g. Dick Johnson's posting).

-Mark



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

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