
groovyx.gpars.csp.JCSPCopy.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gpars Show documentation
Show all versions of gpars Show documentation
The Groovy and Java high-level concurrency library offering actors, dataflow, CSP, agents, parallel collections, fork/join and more
The newest version!
// GPars - Groovy Parallel Systems
//
// Copyright © 2008-10 The original author or authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package groovyx.gpars.csp
public interface JCSPCopy {
/**
* 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
*
* @author Jon Kerridge, Ken Barclay, John Savage
* @version 1.0
*
*/
public abstract copy()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy