On 6/21/06, Simon Peyton-Jones [EMAIL PROTECTED] wrote:
New worker threads are spawned on as needed. You'll need as many of
them as you have simultaneously-blocked foreign calls. If you have 2000
simultaneously-blocked foreign calls, you'll need 2000 OS threads to
support them, which probably
On 6/21/06, Duncan Coutts [EMAIL PROTECTED] wrote:
On linux, epoll scales very well with minimal overhead. Using multiple
OS threads to do blocking IO would not scale in the case of lots of idle
socket connections, you'd need one OS thread per socket.
On Linux, OS threads can also scale very
Hello,
The paper Extending the Haskell FFI with Concurrency mentioned the
following in Section 6.3:
GHC's run-time system employs one OS thread for every bound thread;
additionally, there is a variable number of so-called worker OS
threads that are used to execute the unbounded (lightweight)
Suppose the following happens:
(1) Thread A calls readChan on an empty channel and waits
(2) Thread B puts something to the read-end of the channel using unGetChan
When a GHC program does this, both threads are blocked! Is it the
behaviour we really want for unGetChan, or should we fix the
In GHC, how can I allocate a chunk of memory aligned to some block
size (say, 512 or 1024 bytes)? I tried to specify it in the
alignment method in the Storable typeclass, but that does not seem
to work. Is Storable.alignment really used in GHC? If so, is there a
code example that allocates aligned
[1] Extending the Haskell Foreign Function Interface with Concurrency
[2] Haskell on a Shared-Memory Multiprocessor
I read the above two papers [1,2] and I have been trying to write an
application that uses both FFI and SMP. The first paper [1] shows how
FFI is implemented on uniprocessor