This example program does not terminate:
class Test {
public static def main(args:Array[String]) {
val flag = Cell.make[boolean](false);
async {
flag() = true;
}
when (flag()) ;
}
}
It does terminate, if the async block is made atomic.
Internally, the when-condition blocks and wakes up, whenever an atomic
block ends. This is a reasonable efficiency optimization to avoid
polling (ironically, a spin lock is used). My complain is that this
behavior is not intuitive and not specified (at least not in X10-2.2.0
§14.7.1).
--
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: [email protected]
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
------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide. Store less, Store more with what you own, Move data to
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
X10-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/x10-users