March 2003
Intermediate to advanced
912 pages
27h 17m
English
We discussed earlier the general concept of the critical region, as that section of code where shared data is accessed. Here we show a possible implementation of the concept. A critical region construct requires syntax such as the following to be added to the high-level language:
declaring a data type to be shared, such as:
shared DataType someSharedData
a region declaration such as:
region (someSharedData) { ....}
For each shared data declaration the compiler could create a semaphore, for example crSem. Then, at the start of any critical region construct for that data it could insert a crSem.semWait() operation and a crSem.semSignal() at the end. If the Java syntax included this facility, it would ...