Queue.Queue-like class without the busy-wait

Paul Rubin http
Sat Apr 2 01:46:21 EST 2005


Nick Craig-Wood <nick at craig-wood.com> writes:
> I believe futex is the thing you want for a modern linux.  Not
> very portable though.

That's really cool, but I don't see how it can be a pure userspace
operation if the futex has a timeout.  The kernel must need to keep
track of the timeouts.  However, since futexes can be woken by any
thread, the whole thing can be done with just one futex.  In fact the
doc mentions something about using a file descriptor to support
asynchronous wakeups, but it's confusing whether that applies here.



More information about the Python-list mailing list