Concurrency issue with dynamic linker in GHC

Simon Marlow simonmarhaskell at
Mon Oct 23 09:04:01 EDT 2006

Donald Bruce Stewart wrote:
> bulat.ziganshin:
>>Hello Donald,
>>Sunday, October 22, 2006, 9:04:02 AM, you wrote:
>>>>can't you define this call as 'safe'?
>>>But is it safe. Hmm.... I get kind of queasy when mucking about in the rts.
>>i don't understand you (because of my weak English).
>>'safe' specifier is just says that function should be called in _safe_
>>way that will allow to continue execute other Haskell threads. for
>>functions declared as 'unsafe' GHC uses simplified call method that
>>freezes execution of all Haskell threads until called function will
>>look for details in
> Yes, I understand this. I just don't know how safe it is to have other
> threads continue executing while I'm swapping code in and out of the
> system...

Does indeed sound dodgy.  The only way to prevent other threads from running 
altogether is to compile *without* -threaded and make an unsafe foreign call.


More information about the Glasgow-haskell-users mailing list