Re: Linux Driver - Select Implementation!

Charles Cazabon (charlesc-linux@qcc.sk.ca)
Fri, 26 Feb 1999 11:28:39 -0600


Jeff Epler <jepler@inetnebr.com> wrote:
>
> What would the consequences be of a select-like call which had the semantic
> that only one of the tasks sleeping for that resource was woken (the
> longest-sleeping, perhaps)? (And, probably, all tasks sleeping because
> of regular select()) To my naive mind it sounds like a way to avoid
> the thundering herd problem. Are there unforseen pitfalls in this, or is
> it more a matter of doing something nonstandard, or of the change requiring
> widespread kernel changes?

This thundering herd problem can be solved in userland, if I am not mistaken.
>From what I've read, Apache solves this problem by having a single task do the
select(), and setting an appropriate semaphore on return. The rest of the
tasks which would normally do a select() instead wait on this semaphore -- when
the semaphore is available, a single task is unblocked from waiting on it.

Charles

-- 
----------------------------------------------------
Charles Cazabon           <charlesc-linux@qcc.sk.ca>
Any opinions expressed are just that -- my opinions.
----------------------------------------------------

- 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/