Operation method of task state machine management mechanism
A technology of task state and management mechanism, applied in the field of operating system, can solve the problems of complex design work, high requirements for task-task coupling, difficulty in implementation and improvement of program componentization and standardization, so as to reduce complexity and facilitate operating system , Improve the effect of componentization
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0070] This embodiment describes, introduces and illustrates the definition of the state machine data structure.
[0071] The state machine data structure is the core content of the state machine management mechanism, and each task must have the state machine data structure defined by the state machine data structure. The state machine data structure is defined as follows:
[0072]
[0073] In this embodiment, the data structure includes eight members that implement task functions: instance_id (task index number), state (task state), event_count (total number of events), action_count (total number of actions), event_sources (event trigger source), events (event group), actions_table (action list), machine (mechanism).
[0074] (1) instance_id represents the index number of the task to which the state machine belongs.
[0075] (2) state represents the current state of the task.
[0076] (3) event_count represents the total number of events that will occur during the opera...
Embodiment 2
[0100] In this embodiment, the state machine management mechanism is combined with Figure 4 , Figure 5 to describe, introduce and illustrate; of which, Figure 4 The last three process boxes on the left and the last three process boxes on the right, in Figure 5 merged in.
[0101] (1) Description of the state machine management process
[0102] For the working process of the state machine management mechanism, see Figure 4 understand. First, before the task state machine runs, initialize the task state machine, that is, establish the structure of the task state machine. Then start the task state machine management mechanism.
[0103] After initialization, the task waits for an event to occur, that is, using the event flag mechanism of the operating system to wait for the event flag to be triggered. After the event flag is triggered, the task first obtains the event flag data; secondly, it determines whether the event trigger source (event_sources) has the definition...
Embodiment 3
[0115] This Implementation column describes the implementation of the state machine management mechanism.
[0116] 1. Task state machine initialization: First, the task needs to perform the state machine initialization operation of the task. This operation is mainly to implement a state machine data structure, and the state machine management mechanism will link the state machine data structure to the state machine of the state management mechanism. on the linked list. The main purpose of the state machine data structure is to establish the relationship between the state of the task, the event response of the task, and the action of the task. After the state machine data structure is linked to the target linked list, the state machine management mechanism can manage the state machine of the task.
[0117] 2. Wait for the event to occur and obtain the event flag: After the data machine is established, the task can enable the state machine management mechanism to complete subse...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 