Waiting on Sockets or File Descriptors

Peter Simons simons at cryp.to
Wed Feb 2 14:48:28 EST 2005

Wolfgang Thaller writes:

 > a) poll() is not supported on Mac OS X and (at least some
 > popular versions of) BSD.

Are you certain? Just tried "man poll" on one of the MacOS X
machines the SourceForge compile farm offers, and that one
had it: "Darwin ppc-osx1 5.5 Darwin Kernel Version 5.5".

 > b) 'forkIO' in the threaded RTS would suffice in this
 > case, as the poll() or select() system calls don't use
 > any thread-local state. In the threaded RTS, "safe"
 > foreign imports never affect other threads [...].

That would be really good news! I assumed that GHC's runtime
system used one thread for _all_ FFI invocations? (Unless
you start new ones.) So I thought calling poll() would block
all other FFI invocations until it returned?

Or is that only for "unsafe" FFI calls?

Do you have an URL for me where I can find out more about
this, by any chance?


More information about the Glasgow-haskell-users mailing list