Finite State Machine for Multi-threaded Shared Resource Control
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In real-time multithreaded control environments, synchronization issues between producer and consumer threads can lead to incorrect behavior or system crashes due to timing and interaction problems, especially when physical or logical isolation causes information loss and increases the complexity of state space validation.
Innovation Solution
Implementing a finite state machine that regulates both producer and consumer threads, allowing only one thread to access shared resources at a time through a state-sharing sequence control engine, which reduces the state space and prevents desynchronization by managing threads' sleep and wake periods and ownership of states.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of information
If sideband channels are used for synchronization between producer and consumer threads, then information can be transferred, but information loss occurs due to the filtering effect and temporal decay
Solution Approach 1:
The patent creates a copy of the shared buffer data structure that can be safely accessed by multiple threads. Instead of transferring filtered views through sideband channels, each thread operates on its own copy or accessors to the same underlying data, eliminating information loss during transmission while maintaining synchronization through shared memory semantics.
Solution Approach 2:
The patent introduces accessor functions as intermediaries between producer and consumer threads. These accessors provide a controlled interface to the shared buffer, ensuring that data is accessed in a synchronized manner without direct thread-to-thread communication, thereby preventing information loss while maintaining reliability.
2Adaptability or versatility
If explicit message passing is used to transfer references to internal states, then scaling problems are fixed, but bandwidth, throughput, and latency delays increase
Solution Approach 1:
The patent extracts the synchronization logic from the data flow path by using shared memory with accessor functions. Instead of passing messages through explicit channels, the threads access shared data structures directly through controlled accessors, eliminating message passing overhead and latency while maintaining scaling capability through the shared buffer architecture.
3Reliability
If mutual exclusion policy is used to synchronize producer and consumer threads, then program correctness is maintained, but system performance and throughput are reduced
Solution Approach 1:
The patent implements dynamic access control through accessor functions that adaptively manage thread access to the shared buffer. Instead of rigid mutual exclusion that blocks all concurrent access, the accessors dynamically coordinate between producer and consumer threads, allowing overlapping execution when safe and maintaining correctness only when necessary, thereby improving throughput while preserving program correctness.
Data Source
AI summary
A method for controlling sharing of resources in a multi-threaded environment includes entering a finite state machine state sequence; controlling resource-sharing threads using the finite state machine state sequence; and exiting the finite state machine state sequence when shared resource control is complete. A multi-threaded shared resource control system includes a finite state machine configured to control multi-threaded access to shared resources; a plurality of producer threads regulated by the finite state machine; and a plurality of consumer threads regulated by the finite state machine. A non-transitory computer usable medium having computer readable program code embodied therein for causing a computer system to execute a method for controlling sharing of resources in a multi-threaded environment includes entering a finite state machine state sequence; controlling resource-sharing threads using the finite state machine state sequence; and exiting the finite state machine state sequence when shared resource control is complete.


