Friday, June 22, 2012

On concurrency and fairness in event processing

Uri Cohen from Gigaspaces (an Israeli company) published a presentation on slideshare entitled: 
"event processing at massive scale - approaches to concurrency".  This presentation is motivated by the massive scalability of capital markets trading.  It deals with different methods for concurrency, based on queues and segmentation.   One of the properties it aims to address is fairness. The claim is that single threaded queue is always fair, and when concurrency is used, the fairness issue arises since there the order of execution becomes non deterministic.  The proposed solution is segmentation, and exclusivity within a segment.     The issue of fairness is actually more complex, event in single threaded, the order have to be determined carefully since fairness should be determined according to the occurrence time of the event in the real world, and not the time the event is detected by the system's API,  furthermore, the issue of fairness when derived events are involved becomes even more complex.    I'll write about fairness in length in another post.  In any event - work on concurrency methods, and optimization among the trade-offs related to optimization is important for massive event processing solutions.    More - later.