Description
Random Mode Collectors
Sequential Mode Collectors
Collectors (CLXs) are one the most frequently used CDL objects, and can be thought of as logical AND gates. Any number of connections can be made with the collecting face (shown on left), and when all of the events have arrived, a single compound event is provided to the consuming object, which is connected to the providing face (shown on right). Collections are nestable in the sense that compound events can themselves be collected. Compound events can be split back into their constituent parts by splitter objects (see Splitters).
In random mode, events are simultaneously requested and collected in arrival order; in sequential mode, events are collected in the direction indicated by the collection face indicator. Sequential collection is generally adopted for arbitrated stores that have blocking exclusion; this provides a means of avoiding deadly embraces. In all cases the collector will only provide its output when the last of its inputs is ready, and inputs can become available before or after the collector begins collection. This reduces indeterminacy.
Creation Attributes
Name
Instance name (see Object Names)
Dimensions
Instance dimensionality (see Object Dimensionality)
Presence
Instance presence flag (see Object Presence)
Reentrancy
Instance reentrancy (see Object Reentrancy)
Collection order
Determines the order that the collector requests events on each of its links. If set to 'clockwise' then the collector will request sequentially in a clockwise manner. If set to 'anticlockwise' then collection will also be sequential but in an anticlockwise manner. If set to 'random' then requests will be issued on all links simultaneously. Sequential collection ensures the order that events are requested and this may be required in order to avoid deadlocks. Simultaneous collection reduces latency.
Connection Attributes
Event propagator objects have two types of connection. Those that provide events to their consuming faces, and those that consume events from their providing faces. The attributes associated with any particular connection therefore depend on the providing and consuming object types (see Automatic Connections).
All automatic connections require;
Timeout
This attribute determines whether the connection will poll or block (see Connection Timeout).
Signature
This attribute is a string that describes the mapping from elements in the consumer, to elements in the provider. See Connection Mappings.
Dimensions
This attribute determines the dimensionality of the connection array owned by each consuming element. By default, this will provide the consuming element with one connection for each provider element. Collector, Multiplexor and Manual connection consumers can have multi-dimensional connection arrays, but in all other cases, this attribute will be '1'. See Connection Mappings.
Repeat Count
This attribute determines the number of times that each 'provider element to consumer element' connection is repeated. If the repeat count is greater then one, then the Dimensions attribute (above), and the resulting connection access functions, will both have an 'extra' dimension. Only Collector, Multiplexor and Manual connection consumers can have repeat counts that are greater than '1'. See Connection Mappings.
Name
This attribute determines the connection's 'name' which is used to construct access function names (see Connection Names).
There is one specific attribute required for connections that provide events to a collector's consuming face.
Connection label
This attribute uniquely identifies each collector connection and is referenced by reciprocal splitter connections (see Connection label).
There are no specific attributes required for connections that consume events from a collector's providing face.
Manual Connections
Manual connections provide a means of directly accessing target objects. These are created automatically from CDL diagrams and accessed using their access function names (see Manual Connections).
Collector connections provide the following member functions;
WaitEvent()
This member function issues an 'open' request to the collector (see CLX WaitEvent function).
Close()
This member function closes a previously opened collector (see CLX Close function).
Automatic and Manual Connections
The following member functions can be used to retrieve information from both automatic and manual connections;
IsOpen()
This member function returns TRUE if the connection is 'Open' or FALSE otherwise.
EventNum()
This member function returns the retrieved event's sequence number. Numbering starts from zero (the first retrieved event).
NumLinks()
This member function returns the number of links (connections) owned by the collector's consuming face.
Notes
Collectors cannot be designated as 'transparent' (see object visibility). However, if their output is passed to a splitter object then the collector and all the objects between the collector and the splitter are implicitly transparent to the splitter's consumers. The splitter and intermediate objects are however visible to consumers that do not consume from the collector's reciprocal splitter.
Collectors that have reentrancy greater than 1 can start collection before 'earlier' collections have completed. However, 'later' collections will never 'overtake' earlier collections.
Example
See Collection and Non-Blocking Execution.