Threads Question

Jorge M. Pelizzoni jorgemp at icmc.usp.br
Sat Jan 25 20:05:11 CET 2003


Yes, it is possible that T takes control before Y is bound to 5. But, if
your concern is that T, at some point, needs Y bound, you are actually
not concerned, because it will (implicitly) block until Y gets bound
(that's why Oz is said to be dataflow-oriented). Now, if you really have
a race condition there, you won't be able to avoid explicit
synchronization constructs (locks and the like).

> -----Original Message-----
> From: owner-oz-users at ps.uni-sb.de [mailto:owner-oz-users at ps.uni-sb.de]
On
> Behalf Of HALA MOSTAFA
> Sent: Saturday, January 25, 2003 3:52 PM
> To: users at mozart-oz.org
> Subject: Threads Question
> 
> Hi all,
> I have a question regarding threads. For the following piece of code
> 	{Wait X}
> 	Y = 5
> Suppose there's another thread T in addition to the one waiting on X,
and
> that both threads have the same priority.
> My question is: When X becomes bound, is it guaranteed that the
binding
> Y=5
> will take place immediately after X is bound, or is it possible that
the
> other thread, T, takes control before Y is bound to 5, depending on
the
> scheduler?
> 
> In other words, is a suspended thread resumed as soon as the variable
it's
> waiting for is bound, or can another thread take control?
> 
> Thank you
> 
> 
> 
> 
> 
> _________________________________________________________________
> 
> 
> -
> Please send submissions to users at mozart-oz.org
> and administriva mail to users-request at mozart-oz.org.
> The Mozart Oz web site is at http://www.mozart-oz.org/.
> Please send bug reports to bugs at mozart-oz.org.

-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.
Please send bug reports to bugs at mozart-oz.org.





More information about the mozart-users mailing list