A Linux-based multi-thread hard real-time control method
A control method and hard real-time technology, applied in the field of multi-thread processing, can solve the problem that multiple threads cannot access shared resources at the same time, achieve the effect of hard real-time control, suspend the controlled thread in real time, and restore the controlled thread in real time
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0025] refer to figure 1 , the specific implementation steps of the scheme of the present invention are as follows:
[0026] Step 1: Define a global mutex and initialize the mutex;
[0027] Step 2: Create a main control thread and a controlled thread. One main control thread can control one or more controlled threads at the same time. In this embodiment, there is one main control thread and one controlled thread, which is recorded as the main control thread Thread A and controlled thread B;
[0028] Step 3: Apply for a mutex lock in the main control thread A; perform signal registration in the controlled thread B, and define the corresponding received signal type and received signal processing function; the so-called "signal registration" mainly refers to the A thread registers a signal so that the thread can receive the signal in the future. As for which signal to register, that is, "signal type", this generally uses signals such as "SIGUSR1" and "SIGUSR2" provided by the ...
Embodiment 2
[0035] Step 1: Define a global mutex and initialize the mutex;
[0036] Step 2: Create a master control thread and a controlled thread. One master control thread can control one or more controlled threads at the same time. In this embodiment, there is one master control thread, which is recorded as master control thread A; There are N threads, which are recorded as controlled threads B1, ..., controlled threads BN, N≥2; the main control thread A controls N controlled threads, and each controlled thread needs to be registered as a different signal type. At the same time, each controlled thread uses its own mutex, so that it can be controlled more clearly and accurately. It is possible to separately control the suspension or recovery of different threads, and it is also possible to suspend or resume multiple threads at the same time;
[0037] Step 3: Apply for a mutex in the main control thread A, perform signal registration in the controlled thread B1, ..., and the controlled ...
Embodiment 3
[0043] Step 1: Define multiple global mutexes and initialize the mutexes;
[0044] Step 2: Create a master control thread and a controlled thread. One master control thread can control one or more controlled threads at the same time. In this embodiment, there is one master control thread, which is recorded as master control thread A; There are N threads, recorded as controlled threads B1, ..., controlled threads BN, N≥2; the main control thread A controls N controlled threads, and each controlled thread needs to be registered as a different signal type, so In order to have a clearer and more precise control. It is possible to control the suspension or recovery of different threads separately;
[0045] Step 3: Apply for a mutex in the main control thread A, perform signal registration in the controlled thread B1, ..., and the controlled thread BN, and define the corresponding received signal type and received signal processing function, and the controlled thread B1, ... , the...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com