RE: JavaMemoryModel: Guaranteed semantics for Thread.yield()

From: Miles Sabin (msabin@interx.com)
Date: Wed Jan 02 2002 - 14:19:06 EST


Hans Boehm, Hans wrote,
> But I do think that if you replace Thread 1 by
>
> int i;
> while (x == 0) {
> Thread.sleep(++i);
> }
>
> The result should terminate. Jerry, do you agree?

If longs were unbounded I would agreed. But they aren't, so any
guarantee here can be no stronger than that for,

  Thread.sleep(Long.MAX_VALUE)

But from the point of view of the semantics this should surely be
the same as the guarantee (or lack of it) for Thread.sleep(n) for
any arbitrary long n >= 0. If it isn't, then what's the greatest n
such that the guarantee no longer holds?

Cheers,

Miles

-- 
Miles Sabin                                     InterX
Internet Systems Architect                      27 Great West Road
+44 (0)20 8817 4030                             Middx, TW8 9AS, UK
msabin@interx.com                               http://www.interx.com/

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



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