All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface jcsp.lang.CSProcess

public interface CSProcess

Description

The CSProcess interface should be implemented by any class whose instances are intended to be executed as part of a Parallel construct or to encapsulate some executable functionality. The class must define the run method.

The run method should be made synchronized if executing that method on the same instance of the class in more than one Parallel simultaneously would cause the Object to be left in an inconsistent state.

NOTE: For those familiar with the OCCAM programming language the CSProcess interface is equivalent to the PROC declaration. The constructor of any classes implementing the interface is the PROC definition and the run method the body.

Example

 import jcsp.lang.*;
 public ProcessExample implements CSProcess {
   public ProcessExample(Object value, ChannelOutput out) {
     this.value = value;
     this.out = out;
   }
   public void run() {
     while (true) {
       out.write(value);
     }
   }
 }
 

Author:
P.D.Austin
See Also:
Parallel, ProcessNetwork

Method Index

 o run()

Methods

 o run
 public abstract void run()

All Packages  Class Hierarchy  This Package  Previous  Next  Index