I've also discovered something interesting: when I link with the 'threaded' runtime, but let the program use only one core (with '+RTS -N1'), the problem disappears. How comes? The whole thing remains a mystery, because I think what I'm trying to do is quite common...
Yves Parès wrote: > > There is a minimal code which produces this issue: > http://old.nabble.com/file/p27613138/func.c func.c > http://old.nabble.com/file/p27613138/main.hs main.hs > > > Yves Parès wrote: >> >> Well I tried both 'unsafe' and 'safe', and actually I saw no >> difference... >> Even with 'safe', I see a huge difference between calling a C function >> which sleeps and another which doesn't. When there is a sleep, the other >> thread is really slower (it just prints numbers, and I look at which pace >> they're displayed). > ----- Yves Parès Live long and prosper -- View this message in context: http://old.nabble.com/Threading-and-FFI-tp27611528p27621580.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe