|
org.codehaus.gpars | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
interface JCSPCopy
Method Summary | |
---|---|
java.lang.Object
|
copy()
The interface |
Method Detail |
---|
java.lang.Object copy()
JCSPCopy
is used to define a copy
method
that is used to make a deep copy of an object. In parallel systems an object
is used to encapsulate data only. When an object
is communicated from one process
to another then an object reference is passed from the outputting process to the inputting one,
if the processes are on the same processor. This would mean that two processes could modify the
same object in parallel, which of course is very dangerous. One of the processes has to make
a copy of the object if they are both to work on the same object at the same time. This can be
achieved by always declaring new objects for each iteration of a process, which is wasteful of
memory, or by copying the object. The interface JCSPCopy
gives the basic
definition of such a copy
method.
If an object
is communicated over a network channel there is no need to make
a copy as the object
has to implement Serializable
and a copy
is made by the underlying system. A processor cannot access the memory space of
another processor.
Company: Napier University
Copyright © 2008–2010 Václav Pech. All Rights Reserved.