CN1152542C - Method for protecting task process in multitask operating system - Google Patents
Method for protecting task process in multitask operating system Download PDFInfo
- Publication number
- CN1152542C CN1152542C CNB011293349A CN01129334A CN1152542C CN 1152542 C CN1152542 C CN 1152542C CN B011293349 A CNB011293349 A CN B011293349A CN 01129334 A CN01129334 A CN 01129334A CN 1152542 C CN1152542 C CN 1152542C
- Authority
- CN
- China
- Prior art keywords
- task process
- data
- task
- chained list
- guarding
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Debugging And Monitoring (AREA)
Abstract
The present invention discloses a method for a protecting task process in a multitask operating system, which establishes a protective chained list, a once using leaf node of a convenient calculating method for storing the task process is registered under a main node of a used data type of the task process in the protective chained list. When deleting operation is carried out, the present invention announces other leaf nodes sharing the present deleting data with the task progress. A needle is pointed to the next operating data to make any task progress capable of retrieving all operating current data, and therefore, multiple task processes of the sharing data can be protected to avoid the abnormal state of the task process, or system stopping.
Description
Technical field
The present invention relates to the guard method of task process in a kind of multiple task operating system.
Background technology
Usually, communication system software is in order to solve efficient and real-time problem, and the coupling degree of intermodule is than higher, and the task sharing data of several concurrent execution are inevitable.And, to encode for convenience, a lot of data structures are all with chain sheet form tissue.Chained list uses the mode of dynamic assigning memory usually, and the service efficiency of internal memory is than higher, use very flexible, if but any one link of centre of chained list is interrupted, all might destroy the integrality of chained list, serious meeting causes systemic breakdown.For example, router has a lot of interfaces usually with the equipment of periphery or directly link to each other with user's computer, and these interfaces (interface) have been preserved many configuration informations.Suppose these data chain table organization, (Show interface) is example with display interface information, on a router that a plurality of interfaces are arranged, if display interface information, the order of input display interface information, the main action of this order is exactly to travel through the interface chained list, and the result outputs on the screen, suppose that object information can not finish in a screen demonstration, then shown once shielding needs and waited for that the user sends the order that shows next screen or finish to show.The user can carefully check interface message before kbhit.Because the configuration of router is the multi-user, just can there be a plurality of users to carry out the operation of docking port simultaneously, as display interface information and delete interface etc., show when task suspension wait user continues to operate, must allow other task that this interface is operated, otherwise other task has long wait, and making has very big influence each other between a plurality of tasks.If the display interface order does not once produce data fully when the traversal chained list and finishes, owing to waiting corresponding demonstration task of biding one's time to hang up, therefore at this moment have the data structure that a variable points to the interface correspondence of current demonstration in this task.Specifically, suppose when showing task suspension have a variable pShowIf to point to No. 1 data structure of described display interface in the task,, change other task run so system can switch to owing to show the hang-up of task.Suppose that current another one shares the task process of No. 1 data structure of this interface and deleted data structure No. 1, so at this moment the space pointed to of pShowIf just becomes an illegal space, and then causes showing the abnormal end or the system in case of system halt of task process.
For addressing the above problem, the method one that adopts is to make each task process once produce all data fully at present, but this will waste a large amount of resources; Another way is to add reference count, when pShowIf points to No. 1 data structure of above-mentioned interface, reference count is added 1, and the task process of sharing this data structure is judged reference count when this data structure of deletion, if be not 0, and then deletion action failure.Second method can be used for the data structure that the user can intervene, but just is not suitable for for routing module, because task process may be hung up very long a period of time with route entry, therefore, in the so long time, this route entry can not be updated, and can cause the forwarding mistake.
Summary of the invention
The objective of the invention is to, a kind of guard method of a plurality of task process to shared data in the multiple task operating system is provided, this method can avoid causing owing to the accident deletion of shared data the abnormal end or the system in case of system halt of task process.
For achieving the above object, the invention provides the guard method of task process in a kind of multiple task operating system, this method comprises: creates one and guards chained list, for any one task process that may produce pending operation,
(1) before operation, guard the data acquisition system that chained list is registered a plurality of examples of data type that this task process uses to described, with described data acquisition system is a host type node, simultaneously under described host type node, register a leaf node, in order to preserve the ergodic algorithm that the data acquisition system of a plurality of examples of described data type is carried out needed task process of traversing operation, move this task process then;
When (2) this task process is hung up, notify the described leaf node of guarding this task process registration in the chained list to preserve current data in the operated data subset of this task process, then other task process operations;
When (3) this task process finishes to hang up,, fetch current data in the operated data subset of this task process by the described leaf node of guarding this task process registration in the chained list;
Described method also comprises: for any one task process that may produce deletion action, when carrying out deletion action, notify the described chained list of guarding, to have common father node and share the current pointer of wanting other all leaf nodes of deleted data with this task process, point to the data that the next one in the data subset of its 0 correspondence will be operated.
Above the ergodic algorithm of described this task process of preservation, be preserve a plurality of examples of data type that will operate this task set a data subclass and operate the needed pointer of described data subset.
Because the present invention is for any one task process that may produce pending operation; all will be before operation; under the host node of the described data acquisition system of guarding a plurality of examples of data type that this task process in the chained list uses; register the ergodic algorithm of needed task process of traversing operation is carried out in a preservation to the data acquisition system of a plurality of examples of described data type leaf node; when carrying out deletion action; notify described guarding in the chained list to have common father node with this task process; and share current other all leaf nodes of wanting deleted data; the data that the next one in its corresponding data subset of pointed will be operated; like this; when this task process is hung up; as long as notify the described leaf node of guarding this task process registration in the chained list; current data in the operated data subset of wherein this task process of pointed will be kept at; just can guarantee when finishing to hang up; from above-mentioned leaf node, fetch the current data in the operated data subset of this task process; therefore; the present invention can protect a plurality of task process of shared data in the multiple task operating system, avoids causing owing to the accident deletion of shared data the abnormal end or the system in case of system halt of task process.
Description of drawings
Fig. 1 be the present invention adopt guard chained list schematic diagram 1;
Fig. 2 be the present invention adopt guard chained list schematic diagram 2;
Fig. 3 be the present invention adopt guard chained list schematic diagram 3;
Fig. 4 is the flow chart of the embodiment of the invention;
Fig. 5 be the embodiment of the invention adopt guard chained list state diagram 1;
Fig. 6 be the embodiment of the invention adopt guard chained list state diagram 2;
Fig. 7 be the embodiment of the invention adopt guard chained list state diagram 3;
Fig. 8 be the embodiment of the invention adopt guard chained list state diagram 4;
Fig. 9 be the embodiment of the invention adopt guard chained list state diagram 5;
Embodiment
The present invention is described in further detail below in conjunction with drawings and Examples.
In multitask system, owing to may share a data structure by a plurality of task process, a task process is deleted this data structure of sharing, makes other process to collapse.The reason that causes this situation is not know which variable has pointed to this data structure owing to carry out the task of deletion action.Therefore,, make the variable that can will point to this data structure during in this data structure of deletion accordingly all point to correct position, other task process of sharing this data structure is produced unusually when the process of carrying out the deletion task if a kind of support can be provided.
According to the present invention, at first should create one and guard chained list, in order to the operation of management to shared data, guarding chained list itself, to be used for managing the critical data data structure operable be a two-layer tree, with reference to figure 1, wherein, the host type node is represented a kind of data structure, and the host type node among the figure is interface data structure and route data structure; The subtype node is represented the once use as the host type node data, corresponding interface data structure among the figure, three tasks by three kinds of different order display interface information are arranged: demonstration task 1 and demonstration task 2, demonstration task 3, the host type node is three leaves in the leaf node of interface data structure in the corresponding diagram respectively, expression has three tasks to operate on it simultaneously, demonstration task 1 and demonstration task 2,3 three task process of demonstration task are before operation, need register the use of a docking port data structure respectively, in leaf node separately, to preserve separately use-case to shared data, because in different tasks, the interface that shows may be different, for example: suppose that router has interface 1 to arrive interface 7 totally 7 interfaces, demonstration task 1 needs display interface 1 and interface 3, and demonstration task 2 needs display interface 2, interface 3 and interface 4, and demonstration task 3 needs display interface 4, interface 5 and interface 7; Corresponding route data structure, three tasks by three kinds of different order operation route data structures are also arranged: operation task 1 and operation task 2, operation task 3, the host type node is three leaves in the leaf node of route data structure in the corresponding diagram respectively, and expression has three tasks to operate on it simultaneously.Some information of current operation have been preserved in the leaf node, for example the interface message of current demonstration.
Connect bilevel arrow among the figure and represent set membership, the arrow between the same level is represented brotherhood.Use above-mentioned chained list tree in the system the task process that might hang up manage, as can be seen from the figure show task 1, demonstration task 2, demonstration task 3 has formed brotherhood.
The relation of guarding chained list tree and shared data as shown in Figure 2, suppose that shared data A is a data link table, this table for by data 1 to data 7 totally 7 data acquisition systems that data constitute, have two among the figure respectively by the operation chained list of two task controls, their father node all is that host type is the node of same shared data A.Wherein operate the subclass that chained list 1 operation is made of data in the data acquisition system of shared data A 2,4 and data 5, the subclass that 2 operations of operation chained list are made of data in the data acquisition system of shared data A 1,2,3,4 and data 6.Suppose a certain moment, two operations are all in operating data 2, and the data pointer in two of host node A leaf nodes 1 and 2 all points to data 2 so.
Suppose that have the 3rd task that critical data has been deleted this moment, do not guard chained list if do not use this moment, operate the data that chained list 1 and operation chained list 2 can't find the next one to operate so, data 4 and data 3, and may operate the internal memory that has discharged.If before deleted data 2, make the data pointer in two leaf nodes 1 and 2 point to data 4 and data 3 respectively, situation just changes, as shown in Figure 3.
Fig. 4 is the flow chart of the embodiment of the invention.In the described embodiment of Fig. 4,
If two that two users, 1,2 controls are arranged now show that task process 1 and 2 uses display interface order Show interface display interface information at the same time, supposing has interface 1 to arrive interface 6 totally 6 interfaces, wherein user 1 plans to show 2,4, No. 5 interfaces, and user 2 shows 1,2,3,4,6 interfaces, also has the task process of a user 3 controls to have the ability of deleted data.Before chained list was guarded in use, the described initial value of guarding chained list was set to sky, and the management tree of promptly guarding chained list is empty.
At first show task 1 execution in step 1, before operation, judge the described data type that whether exists this task process to use in the chained list of guarding, also there is not the interface data type in the chained list because guard this moment, therefore, demonstration task 1 execution in step 2, guard the data acquisition system that chained list is registered a plurality of examples of data type that this task process uses to described, it is the interface data type, it comprises by interface 1 to interface 66 data acquisition systems that interface is formed totally, with described data acquisition system is a host type node, follow execution in step 3, under described host type node, the leaf node of a task 1 by name of registration, in order to preserve the ergodic algorithm that the data acquisition system of a plurality of examples of described interface data type is carried out the needed task process of traversing operation, that is to say, preserve a plurality of examples of data type that will operate this task set a data subclass and operate the needed pointer of described data subset.In this example, by interface 1 in interface 6 data acquisition system that totally 6 interfaces are formed, choose 2,4, No. 5 interfaces as a data operation subset, this subclass and the pointer that points to this subclass are saved in task 1 leaf node, certain this preservation and without physical copy go out this oneself preserve the sign that can only preserve 2,4,5 interfaces.Move this task process then; With reference to figure 5;
Then, demonstration task 2 is execution in step 1 also, before operation, judge the described data type that whether exists this task process to use in the chained list of guarding, there has been the interface data type in the chained list because guard this moment, therefore, demonstration task 2 direct execution in step 3, under the interface node in guarding chained list, the leaf node of a task 2 by name of registration, in order to preserve the ergodic algorithm that the data acquisition system of a plurality of examples of described interface data type is carried out the needed task process of traversing operation, in this example, demonstration task 2 chooses 1,2,3,4, No. 6 interfaces are saved in this subclass and the pointer that points to this subclass in task 2 leaf nodes as a data operation subset, move this task process then; With reference to figure 6.
When demonstration task 1 is hung up, demonstration task 2 execution in step 4, also when being shown to interface 2, hang up, and wait for user's kbhit, and notice is guarded chained list and is being used interface 2, just make the current data in the operated data subset of pointed task process 2 in the leaf node task 2 that is kept at task process 2 registration, promptly interface 2, then other task process operations.With reference to figure 8.
The task process of user's 3 controls arrives step 4 through step 1, execution in step 5 delete interfaces 2, when carrying out deletion action, notify the described chained list of guarding, to have common father node and share current other all leaf nodes of wanting deleted data with this task process, the data that the next one in its corresponding data subset of pointed will be operated.Just notice is guarded chained list, and the current pointer with leaf node task 1 and task 2 of guarding chained list moves backward, points to interface 4 and interface 3 respectively, with reference to figure 9.
When two task process that show task process 1 and 2 demonstration tasks 1 and demonstration task 2 and user's 3 controls of user 1,2 control after finishing mission separately, notice is guarded the leaf node that the chain list deletion is registered separately respectively, behind last leaf node of deletion, also to delete the father node of response, after all task process finish, all father nodes are deleted, guard chained list and become empty tree again.
Claims (7)
1, the guard method of task process in a kind of multiple task operating system, this method comprises: creates one and guards chained list, for any one task process that may produce pending operation,
(1) before operation, guard the data acquisition system that chained list is registered a plurality of examples of data type that this task process uses to described, with described data acquisition system is a host type node, simultaneously under described host type node, register a leaf node, in order to preserve the ergodic algorithm that the data acquisition system of a plurality of examples of described data type is carried out needed task process of traversing operation, move this task process then;
When (2) this task process is hung up, notify the described leaf node of guarding this task process registration in the chained list to preserve current data in the operated data subset of this task process, then other task process operations;
When (3) this task process finishes to hang up,, fetch current data in the operated data subset of this task process by the described leaf node of guarding this task process registration in the chained list;
2, the guard method of task process according to claim 1; it is characterized in that: this method also comprises: to described when guarding chained list and registering the data acquisition system of a plurality of examples of data type that this task process uses; also to judge the described data type that whether exists this task process to use in the chained list of guarding; if exist, do not need registration.
3, the guard method of task process according to claim 2 is characterized in that: the described initial value of guarding chained list is set to sky.
4, according to the guard method of claim 1,2 or 3 described task process; it is characterized in that; it also comprises: for any one task process that may produce deletion action; when carrying out deletion action; notify the described chained list of guarding; to have common father node and share the current pointer of wanting other all leaf nodes of deleted data with this task process, point to the data that the next one in its corresponding data subset will be operated.
5, the guard method of task process according to claim 4; it is characterized in that: the ergodic algorithm of described this task process of preservation, be preserve a plurality of examples of data type that will operate this task set a data subclass and operate the needed pointer of described data subset.
6, the guard method of task process according to claim 4; it is characterized in that: described when this task process is hung up; preserving current data in the operated data subset of this task process, is the current data that makes in the operated data subset of this task process of pointed in the leaf node that is kept at this task process registration.
7, the guard method of task process according to claim 4; it is characterized in that: described when this task process finishes to hang up; fetching current data in the operated data subset of this task process, is the current data of obtaining in the operated data subset of this task process of the pointed in the leaf node that is kept at this task process registration.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB011293349A CN1152542C (en) | 2001-06-12 | 2001-06-12 | Method for protecting task process in multitask operating system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB011293349A CN1152542C (en) | 2001-06-12 | 2001-06-12 | Method for protecting task process in multitask operating system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1391386A CN1391386A (en) | 2003-01-15 |
CN1152542C true CN1152542C (en) | 2004-06-02 |
Family
ID=4669089
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB011293349A Expired - Fee Related CN1152542C (en) | 2001-06-12 | 2001-06-12 | Method for protecting task process in multitask operating system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN1152542C (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004334537A (en) * | 2003-05-07 | 2004-11-25 | Sony Corp | Program processing system and method, and computer program |
CN102768720B (en) * | 2012-03-20 | 2019-02-22 | 新奥特(北京)视频技术有限公司 | A kind of method of Process Protection |
CN107885549B (en) * | 2017-11-16 | 2020-10-23 | 信阳师范学院 | Method and system for clearing residual process in TORQUE computing cluster computing node |
CN108279994B (en) * | 2018-01-22 | 2021-04-16 | 北京仿真中心 | Automatic solution method for connection Citrix published application exception |
CN110147247B (en) * | 2019-05-27 | 2023-01-24 | 北京智芯微电子科技有限公司 | Method for realizing management software multitask based on C language |
CN117055988B (en) * | 2023-07-11 | 2024-08-02 | 荣耀终端有限公司 | Lightweight operating system optimization processing method and electronic equipment |
-
2001
- 2001-06-12 CN CNB011293349A patent/CN1152542C/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN1391386A (en) | 2003-01-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3607705B1 (en) | Intelligent thread management across isolated network stacks | |
US7246167B2 (en) | Communication multiplexor using listener process to detect newly active client connections and passes to dispatcher processes for handling the connections | |
KR100733852B1 (en) | Computer system | |
CN105429776B (en) | Method and system for managing functions of virtual network | |
EP1031924A2 (en) | Computer executing multiple operating system | |
US9535756B2 (en) | Latency-hiding context management for concurrent distributed tasks in a distributed system | |
US8813093B2 (en) | Integration of disparate applications on a network | |
CN104871493A (en) | Communication channel failover in a high performance computing (hpc) network | |
JP2009294695A (en) | Transaction parallel control method, database management system, and program | |
CN105138678A (en) | Reading and distributing method and system for map tile data | |
CN107077419A (en) | Use the memory addressing mechanism of the buffer of Lothrus apterus hash table level | |
US7823158B2 (en) | Adaptive scheduling and management of work processing in a target context in resource contention | |
CN1152542C (en) | Method for protecting task process in multitask operating system | |
US6754691B1 (en) | Distributed system, access control process and apparatus and program product having access controlling program thereon | |
CN104618304A (en) | Data processing method and data processing system | |
CN101057219A (en) | Method and system for local authority partitioning of client resources | |
CN1266602C (en) | Entry locking for large data structures | |
CN116881256A (en) | Data acquisition and update method, shared memory initialization method and related devices | |
CN1152338C (en) | Parallel distributed-data base processing method and device | |
US6518973B1 (en) | Method, system, and computer program product for efficient buffer level management of memory-buffered graphics data | |
CN100538665C (en) | Multicomputer system, system board and high-speed cache replacement request disposal route | |
CN105635263B (en) | Access processing method and adapter based on backstage caching | |
JP2001268608A (en) | Real-time object-oriented database for tapi service provider | |
CN100352197C (en) | Device and method for realizing isomerized sub-system hot-plugging | |
JPH08190528A (en) | System management device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20040602 Termination date: 20110612 |