The event processing engine based on TinySTM 1.0.2 illustrates how an STM can be used to build parallel event processing operators. In a summary, event processing operators are difficult to parallelize because, when an operator runs in a multi-core environment, not only accesses to the shared operator state must be synchronized, but also the processing order of the events needs to be guaranteed.
Therefore, even if sometimes fine-grained parallelization with locks is feasible (i.e., the operator code is small and simple), guaranteeing the order is not trivial and requires considerable changes in the algorithm is parallelization is to be exploited. Preserving the order is mostly important in two situations:
- Operator semantics requires events to be processed according its timestamp;
- Some fault tolerance mechanism (e.g., active/passive replication) requires a deterministic multi-threaded processing. The goal of this STM-based engine is that it provides an order-safe parallelization.