Re: [Haskell-cafe] Re: Bound threads

2005-03-03 Thread Marcin 'Qrczak' Kowalczyk
Wolfgang Thaller <[EMAIL PROTECTED]> writes: >> Indeed, my brain is melting, but I did it :-) > > Congratulations. How about we found a "Bound-thread-induced brain > melt victims' support group"? The melt was entertaining :-) > Besides simplicity, one of the main reasons for moving our select()

Re: [Haskell-cafe] Re: Bound threads

2005-03-02 Thread Wolfgang Thaller
Marcin Kowalczyk wrote: Indeed, my brain is melting, but I did it :-) Congratulations. How about we found a "Bound-thread-induced brain melt victims' support group"? [...] I have added some optimizations: I think we had thought of most of these optimizations, but things were already very complex

Re: [Haskell-cafe] Re: Bound threads

2005-03-02 Thread Marcin 'Qrczak' Kowalczyk
"Simon Marlow" <[EMAIL PROTECTED]> writes: >> I've now implemented a threaded runtime in my language Kogut, based >> on the design of Haskell. The main thread is bound. The thread which >> holds the capability performs I/O multiplexing itself, without a >> separate service thread. > > We found tha

RE: [Haskell-cafe] Re: Bound threads

2005-03-02 Thread Simon Marlow
On 01 March 2005 11:21, Marcin 'Qrczak' Kowalczyk wrote: > Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> writes: > >> Why is the main thread bound? > > I can answer myself: if the main thread is unbound, the end of the > program can be reached in a different OS thread, which may be a > problem i

Re: [Haskell-cafe] Re: Bound threads

2005-03-01 Thread Marcin 'Qrczak' Kowalczyk
Benjamin Franksen <[EMAIL PROTECTED]> writes: >> Producer/consumer ping-pong is 15 times slower between threads >> running on different OS threads than on two unbound threads. > > Which OS? Linux/NPTL. A context switch which changes OS threads involves: setitimer pthread_sigmask pthread

Re: [Haskell-cafe] Re: Bound threads

2005-03-01 Thread Benjamin Franksen
On Tuesday 01 March 2005 12:20, Marcin 'Qrczak' Kowalczyk wrote: > Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> writes: > > Why is the main thread bound? > > I can answer myself: if the main thread is unbound, the end of the > program can be reached in a different OS thread, which may be a > probl

Re: [Haskell-cafe] Re: Bound threads

2005-03-01 Thread Marcin 'Qrczak' Kowalczyk
Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> writes: > Why is the main thread bound? I can answer myself: if the main thread is unbound, the end of the program can be reached in a different OS thread, which may be a problem if we want to return cleanly to the calling code. I've now implemented

Re: [Haskell-cafe] Re: Bound threads

2005-02-28 Thread Marcin 'Qrczak' Kowalczyk
"Simon Marlow" <[EMAIL PROTECTED]> writes: >> Is it important which thread executes Haskell code (I bet no) and >> unsafe foreign calls (I don't know)? If not, couldn't the same OS >> thread execute code of both threads until a safe foreign call is made? > > Actually in a bound thread, *all* forei

RE: [Haskell-cafe] Re: Bound threads

2005-02-28 Thread Simon Marlow
On 26 February 2005 12:14, Marcin 'Qrczak' Kowalczyk wrote: > Wolfgang Thaller <[EMAIL PROTECTED]> writes: > >>> Since the main thread is bound, and unbound threads are never >>> executed on an OS thread which has some Haskell thread bound, this >>> would imply that when the main thread spawns a

Re: [Haskell-cafe] Re: Bound threads

2005-02-26 Thread Marcin 'Qrczak' Kowalczyk
Wolfgang Thaller <[EMAIL PROTECTED]> writes: >> Since the main thread is bound, and unbound threads are never executed >> on an OS thread which has some Haskell thread bound, this would imply >> that when the main thread spawns a Haskell thread and they synchronize >> a lot with each other using M

[Haskell-cafe] Re: Bound threads

2005-02-25 Thread Wolfgang Thaller
I'm trying to understand the semantics and implementation of bound threads basing on the conc-ffi paper and others. Since the main thread is bound, and unbound threads are never executed on an OS thread which has some Haskell thread bound, this would imply that when the main thread spawns a Haske