[Haskell-cafe] Re: concurrent haskell: thread priorities

Simon Marlow marlowsd at gmail.com
Mon Jan 12 04:24:24 EST 2009


Neal Alexander wrote:
> Simon Marlow wrote:
>> Neal Alexander wrote:
>>> Thomas DuBuisson wrote:
>>>>     It seems like we could get some priority based scheduling (and 
>>>> still
>>>>     be slackers) if we allow marked green threads to be strictly
>>>>     associated with a specific OS thread (forkChildIO?).
>>>>
>>>>
>>>> I think you want the GHC-only GHC.Conc.forkOnIO
>>>>
>>> GHC.Conc.forkOnIO is helpful but doest work in this case - it doesn't 
>>> attach them to the same OS thread.
>>
>> But it does attach the thread to a particular "virtual CPU" in the GHC 
>> RTS (we call them "capabilities"), with the intention that a virtual 
>> CPU corresponds more or less to a real CPU core.
>>
>> Cheers,
>>     Simon
> 
> Yea, but you still have the problem with FFI that uses TLS don't you? 
> What about having a forkOnOS version with processor affinity? Or is 
> there a way to "upgrade" a thread created with forkOnIO to Bound.

Yes, forkOnOS would be possible (you can write it yourself using the 
primitives, in fact).

> I have a thread with soft real-time requirements that cooperatively 
> yields and uses thread local state. Right now there just doesn't seem to 
> be any options.

Right - real-time and priorities are things that we don't do at the moment, 
unfortunately.

Cheers,
	Simon


More information about the Haskell-Cafe mailing list