Event-Driven RPC System Eliminates Multithreading Overhead
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Multithreaded remote procedure call systems in distributed computing are inefficient due to high overheads from context switching and memory usage, leading to performance degradation and increased complexity with potential errors like deadlocks and race conditions.
Innovation Solution
Implementing a single-threaded event-driven remote procedure call system where server nodes handle multiple client requests using tickets, each representing a logical activity, which are created, processed, and deleted as needed, eliminating the need for multiple threads and associated overheads.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If multiple threads are used to handle client requests, then the system can process more requests simultaneously, but context switching overhead and memory usage increase significantly
Solution Approach 1:
The patent segments the request processing into discrete state machine events that can be queued and processed sequentially. Each request is divided into state transitions (parsed, validated, executed, replied) that are handled as individual events in an event queue, eliminating the need for concurrent threads while maintaining processing capability.
Solution Approach 2:
The system dynamically processes requests through an event-driven architecture where the single thread adapts its processing based on event priority and state machine transitions. The event queue dynamically manages request processing order, allowing the system to handle multiple requests efficiently without static thread allocation.
2Productivity
If multiple threads are spawned for each client request, then request handling capacity increases, but memory overhead from stack allocation for each thread increases
Solution Approach 1:
The patent merges all request processing into a single thread context, eliminating the need for multiple thread stacks. The event-driven architecture allows multiple requests to be processed within the same memory space, sharing the single thread's stack and reducing overall memory overhead while maintaining request handling capacity.
Solution Approach 2:
Instead of allocating separate memory spaces for each thread, the system uses event structures that copy only the necessary request data and state information. Each event contains minimal required data (request ID, state, parameters) that can be processed in the single thread's context, reducing memory consumption compared to full thread stacks.
3Productivity
If thread swapping is used to share processing time, then multiple requests can be handled, but thread blocking and inefficiency occur due to time slicing
Solution Approach 1:
The patent implements continuous useful action through an event queue that maintains a ready list of events waiting for processing. The single thread continuously processes events from the queue without blocking, ensuring that useful work is always being performed. Events are processed in sequence without idle time, eliminating the blocking issues inherent in time-sliced multithreading.
Solution Approach 2:
The system replaces the mechanical thread switching mechanism with an event-driven processing model. Instead of relying on operating system-level context switching and time slicing, the patent uses an application-level event queue that manages request processing sequentially, eliminating the overhead and blocking associated with mechanical thread swapping.
4Device complexity
If a single thread is used for execution, then context switching overhead is eliminated, but the ability to handle multiple simultaneous requests is reduced
Solution Approach 1:
The patent introduces an event queue as an intermediary between incoming requests and the single processing thread. The event queue acts as a buffer and manager, accepting multiple requests, organizing them into state machine events, and delivering them to the single thread for processing. This intermediary enables the single thread to handle multiple simultaneous requests efficiently without direct thread-to-request mapping.
Solution Approach 2:
The system changes the fundamental parameter of request handling from concurrent thread execution to sequential event processing. By transforming requests into discrete events with defined states and transitions, the system achieves high throughput through efficient state machine processing rather than through parallel thread execution, fundamentally changing how simultaneity is achieved.
Data Source
AI summary
A system and method for managing a remote procedure call (RPC) system in a distributed system is disclosed. The distributed computing system is typically implemented as a client server model. A server implements several procedures and offers these procedures as services to clients in the distributed computing system. A server handles multiple RPC requests from multiple clients. A client sends an RPC request to a server; the server processes the requested procedure, and sends a reply back to the client.


