Skip to end of metadata
Go to start of metadata

Communicating Sequential Processes (CSP) provides a formal concurrency model consisting of synchronously communicating independent processes. The model offers deterministic behavior plus it allows developers to combine the processes into composable and reusable components.

Processes, in GPars called Tasks, are concurrently run independent activities, which communicate by sending data through (typically synchronous) channels.

A concurrent implementation of the Sieve of Eratosthenes

GPars Tasks represent active computations. Indirect addressing through channels gives you an enormous flexibility in how and when you wire tasks together. The concept of Promises allows tasks to easily signal events or values to other parts of your program in a thread-safe manner. CSP programms are highly deterministic, which is a very useful quality of concurrent programms.

Tasks can be easily combined with other GPars concepts - with Agents to ease shared-state management or with Dataflow Operators to process streamed data.

For further details, please refer to the Groovy CSP section of the User Guide.

  • No labels