Overview
CDL is a visual language that allows you to create concurrent programs by creating nodes that execute sequential code and connecting these via intermediate nodes that synchronize their execution. Each CDL program consists of a network of interconnected nodes. Each node has a specific function and can respond to and produce events along its connections. Fundamentally, there are two different types of node:
- Passive nodes have specified (fixed) functionality that can't be changed by the programmer
- Active nodes are programmable and can be programmed to perform processing and process events
Passive Nodes
There are two categories of passive node, which are referred to as:
- Event repositories; and
- Event operators
Event repositories are the source of all events within a circuit. They produce events as a result of changes in the state of their underlying resource. For example, a data store can produce an event when it has buffer space available to write to or data available to read:
Event propagators work rather differently; they produce one or more events in response to consuming one or more events (depending on their function). For example, a distributor produces multiple events in response to consuming a single event:
A typical network of these nodes starts with a number of event repositories that produce simple events. These simple events are then combined using event operators into compound events. These compound events may then be further compounded and eventually a single event is produced that represents some complex logical combination of the original simple events:
After combining the simple events to produce a useful compound event, that compound event is typically connected to the input of an active node.
Active Nodes
Active nodes are also part of the core set of operations that are provided as primitive objects by CLIP. However CLIP only provides the event harness and the actual functionality is implemented by the programmer. This means that any piece of sequential code can be placed inside an active node and interact with the CLIP circuitry through the interface provided by the active node.
What this means in practice is that large portions of your existing source code can remain unchanged and you can continue to code in a familiar way but that your program becomes segregated into chunks that live in these active objects and they exchange information by accessing potentially multiple shared event repositories through a tree of event operators.
The above example shows three asynchronously executing method objects ultimately waiting for store events to be generated. A writing method is waiting on a collector object that is in turn waiting for both write events from the stores before running. Each reader method is waiting directly on a read event from each store.
Nodal Objects Provided by CLIP
There is a core set of operations that must be provided as primitive objects by CLIP because either:
- It is not possible to implement them using existing objects; or
- It is not efficient to implement them using existing objects.
The next section considers the Fundamental Concepts of event manipulation, memory management and concurrent execution and the nodal objects used to express these concepts in the CDL symbolism.