Apama 10.15.0 | Developing Apama Applications | Developing Apama Applications in EPL | Implementing Parallel Processing
 
Implementing Parallel Processing
 
Introduction to contexts
Creating contexts
How many contexts can you create?
Using channels to communicate between contexts
Obtaining context references
Spawning to contexts
Channels and contexts
Sending an event to a channel
Sending an event to a particular context
Sending an event to a sequence of contexts
Common use cases for contexts
Samples for implementing contexts
Contexts and correlator determinism
How contexts affect other parts of your Apama application
By default, the correlator operates in a serial manner. In a monitor, you have the option of implementing contexts for parallel processing.
During serial correlator operation, the correlator processes events in the order in which they arrive. Each external event matches zero or more listeners. The correlator executes a matching event's associated listeners in a rigid order. The correlator completes the processing related to a particular event before it examines the next event.
For some applications, this serial behavior might not be necessary. In this case, you might be able to improve performance by implementing parallel processing. Parallel processing lets the correlator concurrently process the EPL in multiple monitor instances. To implement parallel processing, you create one or more contexts.
Note: 
If a license file cannot be found, the number of contexts that the correlator allows to be created is limited. See Running Apama without a license file.
Parallel processing in the correlator is quite different from the parallel processing provided by Java, C++, and other languages. These languages allow shared state, and rely on mutexes, conditions, semaphores, monitors, and so on, to enforce correct behavior. The correlator does not automatically provide shared state. Data sharing happens by sending events between contexts and by using the MemoryStore. See Using the MemoryStore. Parallel processing in the correlator is a message-passing system.