
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⑈

Actually, they should definitly always be advisory. You can't easily write a portable program that depends on either priorities working or fairness for correctness, you would write your code differently in each case. And schedules are intimately tied to an implementation so I wouldn't want to straightjacket them. so, people can use priorities for performance reasons, but never for correctness ones no matter what the concurrency implementation. (unless, of course, a particular implementation gives stronger promises than the standard) John -- John Meacham - ⑆repetae.net⑆john⑈

Hello John, Friday, March 31, 2006, 5:48:30 AM, you wrote:
threadSetPriority :: ThreadID -> Int -> IO ()
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.
afair, Erlang has different strategy. Threads with lesser priority should get _LESSER_ amount of time, but they should still be running -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
participants (2)
-
Bulat Ziganshin
-
John Meacham