![]() |
JavaPartyA distributed companion to JavaCurrent release 1.9.5 Bernhard Haumacher, Thomas Moschny and Michael Philippsen |
|
Contents See also
Powered by
|
Remote Monitor Access (RMA)Since JavaParty 1.07a KaRMI is able to remotely access synchronization monitors of objects on far nodes. With this construct the implementation of transparent synchronized blocks on remote objects is possible. Implementing remote monitor access is non-trivial, because there are specific restrictions regarding the byte code instructions dealing with acquiring and releasing the monitor of an object. These instructions must always be paired, to assert that a monitor acquired in some block of code is released when the control flow leaves this block. This restriction is checked by the byte code verifier at class loading time. Since Java synchronization is bound on static blocks even in byte
code, one can not implement an remote monitor acquire by calling a
remote method of an object and issuing a single
Using the unique representative thread approach described in the section Distributed Threads, it is nevertheless possible to instruct a representative thread for the current distributed thread to acquire and hold the lock of a remote object, while executing a code block locally. The implementation in KaRMI is done using a special remote invocation with early return capabilities as seen in figure 1.
Figure 1. Sequence diagram of remote monitor access. When the red thread in figure 1 wants to acquire the monitor of
remote object Please also refer to the paper "Transparent Distributed Threads for Java". |
|||||||
| For comments and bug reports please use the JavaParty users mailing list. Page design & maintenance: Bernhard Haumacher. Last update: Fri Mar 30 18:46:00 GMT+01:00 2007 Java is a trademark of Sun Microsystems. |