suy...@cse.iitm.ac.in wrote on 12/10/2013 05:25:13 AM:
>
> I am trying to work with X10 runtime and wish to perform some
> modifications in it. I am working with x10-2.3.0 runtime (for quite
> some time now). For the below query I had set X10_NTHREADS=8. The
> program and its input was kept constant for multiple runs. The
queryfollows:
>
> 1) The await() method present in class SimpleLatch -- x10.runtime/
> src-x10/x10/util/concurrent/SimpleLatch.x10 -- has a comment
> (written above it) as "can only be called once". Does this mean that
> "await()" method can only be called once per a "worker" or is there
> something which I am missing. (I observed await() being called more
> than once).
>

Hi,

        The comment means that await can only be called once on each instance
of a SimpleLatch.  Each SimpleLatch object is intended to be used to block
1 Worker exactly once and then discarded.

        If await is being called multiple times on the same SimpleLatch
object, then the results are probably not going to be good (depending on
the state of the SimpleLatch either the Worker calling await a second time
is not going to wait at all (state is already set to true because the
previous synchronization on the SimpleLatch has already completed) or a
Worker may get lost (first synchronization is still in progress, Worker A
is parked and a reference stored in worker field; Worker B erroneously
calls await on the same SimpleLatch object overwriting the worker field
with a pointer to itself)).

--dave
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to