-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 21.09.2012 03:49, Rodrique Djonkou wrote: > Dear, > > Please, I want to declare many variables which can be acceded, in a atomic > way, > from all the Places in the same time. > > I want to have a variable "counter" which can be accessed from all the > places. > And the places can increase at any time. and If a place attempt to increase > the > counter, it sleep until the variable is free. > > In fact I want to simulate a "semaphore"
Your description is not a semaphore. A semaphore blocks on a "decrease" until another activity does "increase" it. For a simple counter, the most efficient method is probably a GlobalRef[AtomicInteger] However, have you tried to use a counter per place? That would significantly improve performance, since you create a bottleneck, if every place has to access the single counter on one place. - -- Andreas Zwinkau Karlsruhe Institute of Technology (KIT) Institut für Programmstrukturen und Datenorganisation (IPD) Lehrstuhl Prof. Snelting Adenauerring 20a 76131 Karlsruhe Phone: +49 721 608 48351 Fax: +49 721 608 48457 Email: zwin...@kit.edu Web: http://pp.info.uni-karlsruhe.de/person.php?id=107 KIT ? University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBAgAGBQJQXFLwAAoJEKm3M8a3pi2i0RwH/iATqF6QOuZyzcg9Nrm/Pa8/ AsjttrmoAPO5mJOnw5yIB4DJr6w++4mDq8rGIJj9UgpEg80IdmiADXs2D1HyQzuH jo1AEAYebm3YS1FGGHFYrTFYAjP32+GYG0H6hYlfI/4E3U32f5gEGWL8s9RMsAZ0 ubfiTsun6iMxg8tbZfg51ALrOz2eHfLMqCtzc5vW0fdsYuTruxndXTco/w8h0sNq ecKdRvy1xsUg2UykyZXK4efOiuSzeqHPAPL005f5kbj4KVBFXSA2xRmRy8Wz3Y0B hT4OUJPXmJwHZaVUepuRHZJ0FXJ7zeq5a+6aLG8PF1ZSv69GSWdr1rOdvpgpwSc= =6Ozb -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users