[Haskell-cafe] Re: FFI and callbacks

Duncan Coutts duncan.coutts at worcester.oxford.ac.uk
Mon Jul 25 11:47:40 EDT 2005


On Mon, 2005-07-25 at 10:08 -0500, John Goerzen wrote:
> On Mon, Jul 25, 2005 at 04:05:15PM +0100, Duncan Coutts wrote:
> > On Mon, 2005-07-25 at 13:47 +0000, John Goerzen wrote:
> > > >  - our "bound threads" design does not require the implementation
> > > >    to support lightweight threads, and hence doesn't let the
> > > >    programmer take advantage of them.
> > > 
> > > In my particular case, the C library isn't aware of threading at all.
> > > While it may be safe to call it from any arbitrary Haskell thread, it
> > > would not be safe to call it from two threads simultaneously.
> > 
> > That's ok. Without the threaded rts, you get just one OS thread being
> > used to make the foreign calls.
> 
> Right, but let's say I do want to use the threaded RTS so I can use
> multiple OS threads; what should I be doing here?

That's harder. Simon and I have been talking about that and he has been
suggesting a few experiments to try.

Duncan



More information about the Haskell-Cafe mailing list