Re: JavaMemoryModel: Fairness Guarantees in the Memory Model?

From: Cliff Click (Cliff.Click@sun.com)
Date: Mon Oct 22 2001 - 23:25:18 EDT


Bill Pugh wrote:

> If, instead, we had:
>
> initially, all variables are 0
> Thread 1
> Volatile1 = 1
>
> Thread 2
> while (Volatile1 == 0);
> print "success"
>
> Then the program would be guaranteed to print "success", because once
> thread 1 terminates, thread 2 must see the change to Volatile1 and then
> terminate.

Why must Thread 1 get any time slices at all?
Why can't Thread 2 grab the first time slice and all remaining slices?

Your rule of 'some thread makes progress' makes sense to me.
Your example looks like you intended a rule of 'every thread makes some
progress' which sounds like a quality of implementation issue, not a
hard and fast guarantee.

Cliff

-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:36 EDT