RE: Re[2]: [Haskell-cafe] Unbound threads and FFI

2005-12-16 Thread Simon Peyton-Jones
I've added a FAQ. Simon | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of | Simon Marlow | Sent: 15 December 2005 09:26 | To: Bulat Ziganshin | Cc: Haskell-Cafe Cafe | Subject: RE: Re[2]: [Haskell-cafe] Unbound threads and FFI | | On 14 December 2005

RE: [Haskell-cafe] Unbound threads and FFI

2005-12-15 Thread Simon Peyton-Jones
PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joel | Reymont | Sent: 14 December 2005 14:37 | To: Haskell-Cafe Cafe | Subject: [Haskell-cafe] Unbound threads and FFI | | How do unbound threads play with FFI? According to Simon PJ, each | foreign call will get its own OS thread if its blocked

RE: Re[2]: [Haskell-cafe] Unbound threads and FFI

2005-12-15 Thread Simon Marlow
On 14 December 2005 18:04, Bulat Ziganshin wrote: Hello Simon, Wednesday, December 14, 2005, 7:39:43 PM, you wrote: Do other Haskell threads get blocked during an FFI call? | safeunsafe --+ -threaded| NO YES no -threaded | YES

Re: [Haskell-cafe] Unbound threads and FFI

2005-12-15 Thread Joel Reymont
Simon, I could not find the paper at the link below but it can be found here: http://www.haskell.org/~simonmar/papers/conc-ffi.pdf The paper does not explain the differences I'm seeing between runs of my program linked with the threaded and non-threaded runtimes. I get crashes with the

Re: [Haskell-cafe] Unbound threads and FFI

2005-12-15 Thread John Meacham
On Wed, Dec 14, 2005 at 04:39:43PM -, Simon Marlow wrote: Do other Haskell threads get blocked during an FFI call? | safeunsafe --+ -threaded| NO YES no -threaded | YES YES this is part of the reason I'd like to see a

[Haskell-cafe] Unbound threads and FFI

2005-12-14 Thread Joel Reymont
How do unbound threads play with FFI? According to Simon PJ, each foreign call will get its own OS thread if its blocked. How does GHC determine if the call is blocked? Does each call get its own OS thread from the start? Sometime later? Does this depend on the safe/unsafe specs of the

RE: [Haskell-cafe] Unbound threads and FFI

2005-12-14 Thread Simon Marlow
On 14 December 2005 14:37, Joel Reymont wrote: How do unbound threads play with FFI? According to Simon PJ, each foreign call will get its own OS thread if its blocked. How does GHC determine if the call is blocked? Does each call get its own OS thread from the start? Sometime later? When

Re: [Haskell-cafe] Unbound threads and FFI

2005-12-14 Thread Joel Reymont
On Dec 14, 2005, at 3:21 PM, Simon Marlow wrote: this only happens in the -threaded RTS, in the non-threaded RTS a FFI call will block all the other Haskell threads. Just to be absolutely sure... Does the above apply to safe _and_ unsafe FFI? I have been using the non-threaded runtime

RE: [Haskell-cafe] Unbound threads and FFI

2005-12-14 Thread Simon Marlow
On 14 December 2005 15:34, Joel Reymont wrote: On Dec 14, 2005, at 3:21 PM, Simon Marlow wrote: this only happens in the -threaded RTS, in the non-threaded RTS a FFI call will block all the other Haskell threads. Just to be absolutely sure... Does the above apply to safe _and_ unsafe

Re[2]: [Haskell-cafe] Unbound threads and FFI

2005-12-14 Thread Bulat Ziganshin
Hello Simon, Wednesday, December 14, 2005, 7:39:43 PM, you wrote: SM Do other Haskell threads get blocked during an FFI call? SM | safeunsafe SM --+ SM -threaded| NO YES SM no -threaded | YES YES there is also `threadsafe` specifier.