- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/colby_parsons_MMAth/text/mutex_stmt.tex
r80fc78f r000d68f 83 83 \end{figure} 84 84 85 Like Java, \CFA monitors have \Newterm{multi-acquire} semantics so the thread in the monitor may acquire it multiple times without deadlock, allowing recursion and calling o ther MX functions.85 Like Java, \CFA monitors have \Newterm{multi-acquire} semantics so the thread in the monitor may acquire it multiple times without deadlock, allowing recursion and calling of other MX functions. 86 86 For robustness, \CFA monitors ensure the monitor lock is released regardless of how an acquiring function ends, normal or exceptional, and returning a shared variable is safe via copying before the lock is released. 87 87 Monitor objects can be passed through multiple helper functions without acquiring mutual exclusion, until a designated function associated with the object is called. 88 88 \CFA functions are designated MX by one or more pointer/reference parameters having qualifier @mutex@. 89 89 Java members are designated MX with \lstinline[language=java]{synchronized}, which applies only to the implicit receiver parameter. 90 In the example , the increment and setter operations need mutual exclusion, while the read-only getter operation is not MX because reading an integer is atomic.90 In the example above, the increment and setter operations need mutual exclusion, while the read-only getter operation is not MX because reading an integer is atomic. 91 91 92 92 As stated, the non-object-oriented nature of \CFA monitors allows a function to acquire multiple mutex objects.
Note: See TracChangeset
for help on using the changeset viewer.