Threadsafe Non-Threadsafe Library Execution via Bridge Routines
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing data analysis software, due to adherence to older programming practices, often becomes incompatible with multi-threaded execution environments, leading to inefficient use of processing resources and potential errors when executed across multiple threads, especially when relying on non-threadsafe library routines.
Innovation Solution
A processor-based system that parses analysis routines to determine multi-threaded execution and non-threadsafe library calls, instantiates separate processes and bridge routines to enable safe execution across multiple threads, allowing for parallel execution of non-threadsafe library functions within isolated processes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If software adheres to older programming practices, then it maintains legacy functionality and compatibility, but it becomes incompatible with multi-threaded execution environments and cannot utilize modern processing capabilities
Solution Approach 1:
The patent introduces a thread safety layer that acts as an intermediary between multi-threaded analysis routines and non-threadsafe library routines. This layer detects calls to non-threadsafe functions and manages thread-safe execution contexts, allowing legacy software to run in multi-threaded environments without rewriting the core library code.
Solution Approach 2:
The patent segments the software execution environment into distinct contexts, creating isolated thread execution contexts for calls to non-threadsafe library routines. Each context maintains its own state, preventing interference between concurrent threads while allowing the legacy library code to remain unchanged.
2Reliability
If restrictions are imposed on software execution to maintain thread safety, then errors are prevented, but processing resources are wasted due to single-threaded execution
Solution Approach 1:
The patent implements dynamic context switching that allows the system to adaptively manage thread execution. When a non-threadsafe function is called, the system dynamically creates an isolated execution context for that specific call while allowing other threads to continue executing concurrently, thus maintaining both thread safety and parallel processing capability.
Solution Approach 2:
The patent ensures continuous parallel processing by managing multiple thread execution contexts simultaneously. Rather than blocking other threads when one thread calls a non-threadsafe function, the system maintains continuous useful action across all threads through context isolation and management.
3Productivity
If non-threadsafe library routines are executed in a multi-threaded environment, then processing speed increases through parallel execution, but resource wastage and errors occur
Solution Approach 1:
The patent introduces a thread safety layer that acts as an intermediary between multi-threaded analysis routines and non-threadsafe library routines. This layer detects calls to non-threadsafe functions and manages thread-safe execution contexts, allowing legacy software to run in multi-threaded environments without rewriting the core library code.
Solution Approach 2:
The patent creates isolated copies of execution contexts for each thread calling non-threadsafe library routines. Each context maintains its own state variables and execution environment, effectively copying the necessary state to prevent interference between concurrent threads while allowing parallel execution to proceed.
Data Source
AI summary
An apparatus includes a processor and a storage storing instructions causing the processor to determine whether an analysis routine is multi-threaded and calls a library function of a non-threadsafe library, and if so, causes the processor to: instantiate an analysis process for executing the analysis routine on multiple threads; instantiate an instance of the library for execution within a isolated library process; instantiate another instance of the library for execution within another isolated library process; retrieve library metadata providing a function prototype of the library function; employ the function prototype to generate an instance of a bridge routine to enable a call from the analysis routine on a first thread to the library function; employ the function prototype to generate another instance of the bridge routine to enable a call from the analysis routine on a second thread to the library function; and begin execution of the analysis routine.


