Dear list,

I have a program using more than one places. Now I am starting several
concurrent activities on different places which execute an algorithm that
needs mutual exclusion against the other activities on all other places, so
it also has to communicate with the other places. Is it possible in any way
to realize a mutual exclusion involving more places. I tried already things
with locks and monitors from the X10 standard library and experimented with
such kind of code:

val lockRef = GlobalRef[Lock](new Lock());

for(p in Place.places()) {
  at (p) async {
    // enter atomic
    at (lockRef.home) {
      val lock = lockRef();
      lock.lock();
    }
    ...
    // leave atomic
    at (lockRef.home) {
      val lock = lockRef();
      lock.unlock();
    }
  }
}

I know, this is not very desirable and not very performant. It is just a
simple implementation of the algorithm, a more complex one should be
decentralized. I just want to know, if it's possible to realize an atomic
involving more places, otherwise I don't spend more time for this simple
algorithm and concentrate one the decentralized one.

Thank you very much for your help.

Best regards,

Sascha
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to