Concurrency (was: Re: [GUI] Re: events & callbacks)

Axel Simon A.Simon@ukc.ac.uk
Thu, 13 Mar 2003 09:06:43 +0000


On Thu, Mar 13, 2003 at 12:42:04AM +0100, Wolfgang Thaller wrote:
> >- We most surely do *not* want foreign C calls to be run in a 
> >different OS thread
> > and don't want the "threadsafe" keyword here. (I am opposed to such 
> >extension --
> > complexity without reason - run your OS threads from C yourself!)
> 
> We (I have to admit, that means: I) most surely *do* want the 
> "threadsafe" keyword here.
I am not on the FFI list. Could you explain what threadsafe means in a 
call to C? I though you would specify a thread name each time you call C 
and the Haskell RTS would make sure that you always call C with the same 
OS thread.

> >Now, I think that we should use "idle time" events to solve this.
 We just had this discussion on gtk2hs-users. I propose:
3) if the underlying Haskell RTS is single threaded, the library should 
automatically call "yield" whenever it is idle to ensure that forked 
Haskell processes continue to run.

Then, no matter if the RTS is multithreaded or not, the user would always 
experience the same behaviour.

> It would be a big mistake to write the specification in a way that is 
> incompatible with a planned feature of the next version of GHC.
We don't want to break with GHC, do we? :-)

Axel.