[gambit-list] Threads blocking and IO

Jeff Read bitwize at gmail.com
Tue Jan 29 17:13:29 EST 2008


Hi François,

On Jan 29, 2008 3:27 PM, François Magnan <francois.magnan at licef.ca> wrote:

> I think this may lead me to a solution to my bug but I don't clearly
> understand the statement. Could there be an IO operation that blocks all my
> threads?
> Any help would be greatly appreciated.

My understanding is that Gambit uses non-blocking I/O internally
combined with appropriate "wait until resource is ready or there's a
timeout" system calls (e.g., select() for Unix,
WaitForMultipleObjects() for Windows) to simulate blocking I/O with
multiple user-space threads. So an I/O operation that blocks all
threads is theoretically possible -- any I/O that is blocking *at the
system level* will block all threads. So things like Gambit's
host-info (which calls gethostbyname() -- blocking socket I/O) will
block all threads but only until it returns the host info or errors.

I hope this info helps you find your bug.

--Jeff



More information about the Gambit-list mailing list