JEE Event Queue Synchronization for Session State Integrity
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The Java Enterprise Edition (JEE) platform lacks efficient means to synchronize event processing in telecommunications networks, leading to potential session state corruption and resource inefficiency due to concurrent updates by multiple threads, and existing solutions either block threads or violate resource management principles.
Innovation Solution
A method and apparatus that utilize an event queue associated with each application session, where only the first event in the queue is processed, with a synchronizing unit ensuring that tasks are scheduled and processed sequentially, using an atomic counter or lock to prevent race conditions, allowing efficient thread pool utilization without deadlocks or livelocks.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If multiple threads process events in parallel on the JEE platform, then throughput of task execution is increased, but session state corruption occurs due to concurrent updates
Solution Approach 1:
The patent introduces an event queue as an intermediary between message reception and event processing. The queue serializes access to session state updates, allowing multiple threads to process tasks in parallel while ensuring that only one thread processes events for a given session at a time, thus preventing session state corruption
Solution Approach 2:
The patent segments the processing workflow into distinct stages: message reception, event queuing, and event processing. By separating message handling from event processing through the event queue, the system allows parallel task execution while maintaining sequential event processing for each session, resolving the contradiction between throughput and state integrity
2Reliability
If locks or semaphores are used to prevent concurrent updates, then session state integrity is maintained, but thread blocking occurs reducing resource efficiency
Solution Approach 1:
The event queue serves as a mediator that eliminates the need for locks and semaphores. By design, the queue structure ensures that only one event processing task can be active per session at any time, providing state integrity through structural constraints rather than synchronization primitives, thus avoiding thread blocking
Solution Approach 2:
The system dynamically assigns events to available threads based on queue state. When events are processed sequentially through the queue, threads are dynamically allocated to process the next available event without blocking, maintaining both state integrity and resource efficiency through adaptive thread management
3Reliability
If one dedicated thread is assigned to each application session, then event synchronization is ensured, but resource efficiency decreases due to excessive thread usage
Solution Approach 1:
The event queue provides a universal mechanism that works for all application sessions regardless of the number of threads in the pool. Multiple threads can service the same queue, and the queue itself enforces the one-event-at-a-time rule for each session, eliminating the need for dedicated threads per session while maintaining synchronization
Solution Approach 2:
The event queue is self-regulating, automatically ensuring that only one event processing task is active per session without requiring external thread management. The queue structure itself provides the synchronization mechanism, allowing the system to use a shared thread pool efficiently without dedicating specific threads to specific sessions
Data Source
Figure 1~2
Figure 3
Figure 4
AI summary
A processing platform, for example a Java Enterprise Edition (JEE) platform comprises a JEE cluster (1) having a plurality of processors (3), which include a resource adapter (11) for handling events associated with one or more application sessions Si to Sn. Each application session Si to Sn comprises a session state (15) and an event queue (17), the event queue (17) containing a list of events to be executed for a particular one of the sessions S1 to Sn. A thread pool (19) comprises one or more processing threads t1 to tN for enabling the processor (3) to perform multiple tasks in parallel. The thread pool (19) comprises a task queue (21) containing the tasks to be executed by the processing threads t1 to tN. The resource adapter (11) comprises a synchronizing unit (23) for controlling how the plurality of threads t1 to tN from the thread pool handle the events in the plurality of application sessions S1 to Sn. In particular, the synchronizing unit (23) is configured such that only one event queued in an event queue (17) has a task scheduled thereto in the task queue (21), thereby preventing more than one event from a particular event queue of an application session being executed in parallel.