Concurrent Haskell (GHC) and Win32 Applications ?
Mon, 11 Mar 2002 08:43:46 -0800
"Simon Peyton-Jones" <[email protected]> writes:
> | The problem I think is with the lightweight thread implementation -
> | Win32 calls can (and will) block the OS thread that makes the call,
> | which blocks the entire system. Given that I'm wanting to write a
> | network server with a Win32 GUI, this is obviously a Bad Thing.
> Yes, that's true at the moment, but it's something that we expect
> to fix shortly. More precisely, Sigbjorn has been working on a
> fix. It relies on using an OS thread to make a potentially-blocking
> call, so it's a robust fix.
> I don't quite know when he'll be done with this -- Sigbjorn do you know?
Modulo settling a couple of minor implementation details, I'd say it's done.
To try it out, check out the fptools/ CVS sources, and configure & build
it with the option --enable-threaded-rts
Non-blocking callouts are enabled by attributing a 'foreign import' with
'threadsafe' (instead of 'unsafe' or 'safe') -- e.g.,
foreign import "wait" threadsafe snail :: IO ()