![]() |
JavaPartyA distributed companion to JavaCurrent release 1.9.5 Bernhard Haumacher, Thomas Moschny and Michael Philippsen |
|
Contents See also
Powered by
|
Transparent ThreadsSince JavaParty 1.07a With transparent distributed threads, JavaParty provides unmodified Java thread semantics regarding synchronization and thread control in the distributed environment. Transparent synchronizationUnlike in RMI and other RPC-style middle-ware platforms, synchronization semantics in JavaParty is the transparent extension from one virtual machine to the whole distributed environment. Synchronization reentranceIn JavaParty, a distributed thread is allowed to re-enter an once acquired monitor no matter how many interleaving remote invocations are on the stack in between. This extends the Java thread semantic from one virtual machine to the whole distributed JavaParty environment. With RMI and other RPC-style middle-ware platforms, re-entering a synchronization with interleaving remote method calls causes a dead-lock of the running application thread. Details are explained in the section about Distributed Threads and the paper "Transparent Distributed Threads for Java". Synchronized blocksBesides synchronized methods, the Java language has so called synchronized blocks that are blocks of code synchronized on an arbitrary object. The object used for synchronization has not necessarily to be the one the surrounding method belongs to. In JavaParty, synchronized blocks are supported on arbitrary objects whether they are local or remote. This is possible because KaRMI supports "Remote Monitor Access (RMA)". JavaParty uses this feature to acquire the monitor of the object on the remote node, if the argument to the synchronized block statement is detected to be remote at runtime. With a middle-ware platform like RMI or pure KaRMI blocks synchronized on remote objects are not possible, because the synchronization is acquired on the remote reference instead of the remote object itself. Details are explained in the section about RMA and the paper "Transparent Distributed Threads for Java". Transparent thread controlA thread of control spanning multiple virtual machines is managed by JavaParty as a whole. Control signals such as interrupts sent to a particular thread always reach the current head of control regardless whether it currently executes on a remote node or not. With RMI, management of distributed threads is not possible, because interrupt signals only reach the local Java thread. If this thread is currently waiting in a remote method execution, the signal to get stuck at the local node waiting for the remote invocation to return. If the interruption is the only signal set to the thread this also causes a dead-lock. Details are explained in the paper "Transparent Distributed Threads for Java". Identification of transparent distributed threadsKaRMI provides distributed threads with an unique identifier. This thread ID is used internally, but may also be used by the application to identify a distributed thread of control. Regular Java has no means to identify a thread other than its corresponding thread object. In a distributed environment, the thread object is no longer appropriate for identification, because it is bound to the virtual machine where the distributed thread originated. For details of thread IDs in KaRMI please consult the API
documentation of the class How to enable transparent threads in JavaPartyDistributed threads are enabled in JavaParty by default. Since there is some overhead regarding the latency of remote method invocations, you may want to disable the transparent distributed thread feature if your application only uses basic synchronization patterns. There are two Java runtime properties that control the management of distributed threads:
Details are explained in 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. |