Concurrency issue with dynamic linker in GHC

Donald Bruce Stewart dons at cse.unsw.edu.au
Sun Oct 22 22:37:27 EDT 2006


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
> return
> 
> look for details in http://www.haskell.org/~simonmar/papers/conc-ffi.pdf

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...
  
> >     foreign import ccall unsafe "lookupSymbol"
> >        c_lookupSymbol :: CString -> IO (Ptr a)

This could be safe, then, for other threads to continue. Yes.

-- Don


More information about the Glasgow-haskell-users mailing list