thread priorities?

John Meacham john at repetae.net
Thu Mar 30 20:48:30 EST 2006


Thinking about it some. I think we will need some sort of very basic
thread priorities.

honoring these priorities will be _manditory_ for cooperative
implementations but advisory for preemptive ones that meet the fairness
guarentees. priorities are sometimes needed in cooperative systems to
ensure certain things get run, but the fairness guarentees of preemptive
systems make them less important. Another reason to make them advisory
in preemptive implementations is because they might be using OS level
threads and hence not have their own scheduler to tweak priorities in.


I am thinking 

threadSetPriority :: ThreadID -> Int -> IO ()
threadSetPriority = ...

with a small modification to the progress guarentee saying that when
threads of different priorities are runnable, one of the threads of the
highest priority will be running. we should also say something about
priority inheritance via MVars...

but perhaps this is too complicated for the spec and should be left up
to the implementations (or just make it always advisory). let me know
what y'all think.

        John


-- 
John Meacham - ⑆repetae.net⑆john⑈


More information about the Haskell-prime mailing list