guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recursive mutexes?


From: Rob Browning
Subject: Re: Recursive mutexes?
Date: Sun, 27 Oct 2002 12:33:49 -0600
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-pc-linux-gnu)

Neil Jerram <address@hidden> writes:

> Win32 has this: `WaitForMultipleObjects'.  Can it be done in a POSIX
> system without polling?

Yes, I think so -- if you let a helper thread (or threads) handle
watching for whatever events the user threads are interested in.  The
watcher thread(s) then signals a condition variable (or semaphore or
whatever) that the user thread is blocked on whenever an event the
user thread is interested in arrives.

Whether you have one watcher thread or many, and whether you break
them up by type or not (say one for POSIX IO, one for GTK, one for
KDE), depends on implementation details.

This presumes that the events that the helper thread(s) will be
watching can be waited on without polling, but even if polling is
required, it can be limited to the relevant watcher thread(s).

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD




reply via email to

[Prev in Thread] Current Thread [Next in Thread]