org.codehaus.gpars

groovyx.gpars.csp
[Groovy] Interface JCSPCopy


interface JCSPCopy

Method Summary
java.lang.Object copy()

The interface JCSPCopy is used to define a copy method that is used to make a deep copy of an object.

 

Method Detail

copy

java.lang.Object copy()
The interface 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

Authors:
Jon Kerridge, Ken Barclay, John Savage
Version:
1.0


 

Copyright © 2008–2012 Václav Pech. All Rights Reserved.