Concurrency issue with dynamic linker in GHC

Bulat Ziganshin bulat.ziganshin at gmail.com
Mon Oct 23 03:33:44 EDT 2006


Hello Vyacheslav,

Monday, October 23, 2006, 7:20:47 AM, you wrote:

> Bulat: I didn't get the chance to use the streams library yet, but
> could you explain how it would solve my locking problem? The core
> problem that the runtime under Win32 doesn't have an IO manager still
> remains, correct?

i will say instead "ghc I/O library on windows doesn't include IO manager".

there are 3 possible ways to implement I/O:

1) use read() calls marked as unsafe. it will block all haskell
threads while one thread do I/O

2) use calls marked as safe. your I/O becomes fine

3) implement I/O manager which will make special asyncRead() calls and
then wake up just the Haskell thread that completed its i/o. in terms
of functionality, it's the same as 2), but a MUCH faster when you have
a lot of I/O (imagine web server with thousands of threads running
simultaneously)


GHC i/o lib implements 3) on unixes but only 1) on windows. my Streams
lib implement 1) on any system. BUT...

all that you need to switch my lib to 2) is to edit System.FD module
and mark imports as 'safe'. with GHC I/O lib it will be a hard task,
believe me :)


> Is anyone looking to fix this issue? If not, how hard would it be for
> me to fix it? I'd like to get my hands dirty with GHC but I don't
> think I'll be able to do it without a lot of direction.

wait a moment. GHC headquarter don't work at weekends ;)


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Glasgow-haskell-users mailing list