RE: Concurrent Haskell (GHC) and Win32 Applications ?
| 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? Meanwhile, all you can do is to avoid making blocking I/O calls. Simon
"Simon Peyton-Jones" <simonpj@microsoft.com> 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 () --sigbjorn
"Sigbjorn Finne" <sof@galois.com> writes:
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.
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
Ahem - how far would this be from a "real" multithreaded implementation, i.e. one that could use a few OS threads to take advantage of multiple CPUs in an SMP system? -kzm -- If I haven't seen further, it is by standing in the footprints of giants
participants (3)
-
ketil@ii.uib.no -
Sigbjorn Finne -
Simon Peyton-Jones