Multithreaded Fork Operation for In-Memory Checkpointing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The fork function does not work well with multithreaded programs because only the thread calling the operation is duplicated, and other threads are not present in the child process, leaving synchronization points in an undefined state.
Innovation Solution
A method that directs a multithreaded program to execute only one primary thread, stops other threads, duplicates the code to create a child process with a copy of the primary thread, restarts the other threads, and recreates synchronization points to mirror the original multithreaded execution.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If fork operation is used to create memory image in multithreaded program, then in-memory checkpointing is enabled, but only the calling thread is duplicated and other threads are not present in the child process
Solution Approach 1:
The patent applies preliminary action by suspending all threads before the fork operation and then restoring them after the child process is created. This ensures that the fork operation captures a consistent state of all threads, not just the calling thread, enabling accurate in-memory checkpointing of multithreaded programs.
Solution Approach 2:
The patent uses an intermediary mechanism (thread suspension and restoration logic) to coordinate between the fork operation and multithreaded execution. This intermediary layer manages the complexity of capturing multiple thread states by temporarily stopping thread execution, performing the fork, then restoring threads to continue execution from suspended points.
2Reliability
If fork operation is used to create memory image, then program state can be saved, but all thread synchronization points are left in undefined state
Solution Approach 1:
The patent applies preliminary action by suspending all threads before the fork operation. This ensures that thread synchronization points are in a known, consistent state when the fork occurs, rather than being left in undefined states. After the fork, threads are restored and resume from their suspended points, maintaining synchronization integrity.
3Productivity
If fork operation is used while program is running, then program execution is not suspended, but only the calling thread is duplicated
Solution Approach 1:
The patent applies preliminary action by temporarily suspending all threads before the fork operation. This allows the fork to capture complete thread states while maintaining the ability to restore execution continuity. The threads are then restored and resume execution from their suspended points, maintaining productivity while ensuring reliability.
Data Source
AI summary
A method for performing a fork operation on a multithreaded application includes executing a component-based code including a set of instructions comprising multiple threads. The method further includes receiving a request from a controlling process to perform a fork operation on the component-based code at an instruction within the component-based code and directing the fork operation on the component-based code. The method further includes causing the component-based code to execute only one primary thread of the multiple threads by stopping execution of the other multiple threads, duplicating the component-based code at the instruction to create a child process comprising a copy of the primary thread, restarting execution of the other multiple threads in the component-based code, performing a correction of the child process, and creating multiple threads of the child process. The multiple threads of the child process mirror the multiple threads of the component-based code.


