[Haskell-cafe] concurrency vs. I/O in GHC

Gregory Crosswhite gcross at phys.washington.edu
Sat Oct 23 16:20:49 EDT 2010


On 10/23/10 12:57 PM, Claude Heiland-Allen wrote:
> On 23/10/10 17:42, Gregory Crosswhite wrote:
>> On 10/23/10 7:54 AM, John Lato wrote:
>>> On Fri, Oct 22, 2010 at 6:16 PM, Bulat Ziganshin
>>>
>>> This doesn't work, which was why the OP asked in the first place. When
>>> a thread calls an unsafe foreign function, it blocks everything until
>>> that function returns.
>>>
>>
>> Is that true? The last time we discussed this in Haskell Cafe the
>> conclusion I drew from the discussion was that unsafe foreign functions
>> block the current thread but not any other thread.
>
> The conclusion I drew was that "unsafe" foreign functions block the 
> current "capability" (OS thread) and any "threads" (Haskell forkIO 
> etc) currently scheduled on that capability, but other capabilities 
> and threads continue executing as normal.

Yes, that is what I really meant to say;  thank you for using the 
correct words. :-)

Cheers,
Greg


More information about the Haskell-Cafe mailing list