CN1391386A - Method for protecting task process in multitask operating system - Google Patents

Method for protecting task process in multitask operating system Download PDF

Info

Publication number
CN1391386A
CN1391386A CN 01129334 CN01129334A CN1391386A CN 1391386 A CN1391386 A CN 1391386A CN 01129334 CN01129334 CN 01129334 CN 01129334 A CN01129334 A CN 01129334A CN 1391386 A CN1391386 A CN 1391386A
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.)
Granted
Application number
CN 01129334
Other languages
Chinese (zh)
Other versions
CN1152542C (en
Inventor
朱英明
吴小前
李莉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB011293349A priority Critical patent/CN1152542C/en
Publication of CN1391386A publication Critical patent/CN1391386A/en
Application granted granted Critical
Publication of CN1152542C publication Critical patent/CN1152542C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A method for protecting the task process in multi-task operating system includes such steps as creating a daemon chain table, registering a leaf node using ergodic algorithm to preserve the processes of this task to a host node created in said table, informing other leaf nodes sharing the data when the data is deleted, and making the pointer to point next data to be processed.

Description

The guard method of task process in a kind of multiple task operating system
The present invention relates to the guard method of task process in a kind of multiple task operating system.
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.
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 ergodic algorithm, move this task process then to needed the task process of this use of data acquisition system of a plurality of examples of described data type;
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 its corresponding data subset 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 leaf node of a preservation to the ergodic algorithm of needed the task process of this use of data acquisition system of a plurality of examples of described data type; 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.
The present invention is described in further detail below in conjunction with drawings and Examples.
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;
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, this uses the ergodic algorithm of needed task process to the data acquisition system of a plurality of examples of described interface data type in order to preserve, and 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, this uses the ergodic algorithm of needed task process to the data acquisition system of a plurality of examples of described interface data type in order to preserve, 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.
Demonstration task 1 execution in step 4, when being shown to interface 2, this task process is hung up, and wait for user's kbhit, notice is guarded chained list and is being used interface 2 simultaneously, just notify the described leaf node of guarding this task process registration in the chained list, be that task 1 leaf node is preserved current data in the operated data subset of this task process, just make the current data in the operated data subset of this task process of pointed in the leaf node task 1 that is kept at this task process registration, be interface 2, other task process operations then.With reference to figure 7.
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.
Demonstration task 1 and demonstration task 2 be execution in step 5 respectively, when finishing to hang up, by the described leaf node of guarding this task process registration in the chained list, fetch current data in the operated data subset of this task process, just obtain the current data in the operated data subset of this task process of the pointed in the leaf node that is kept at this task process registration.Because the pointer in leaf node task 1 and the task 2 has pointed to interface 4 and interface 3 in the data manipulation subclass separately respectively, demonstration task like this 1 and demonstration task 2 are when finishing to hang up, demonstration task 1 and display interface 4, and demonstration task 2 display interfaces 3.Just guaranteed that demonstration task 1 and demonstration task 2 can not cause because of the deletion of interface 2 traveling through interface again, even cause systemic breakdown like this.
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 ergodic algorithm, move this task process then to needed the task process of this use of data acquisition system of a plurality of examples of described data type;
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.
CNB011293349A 2001-06-12 2001-06-12 Method for protecting task process in multitask operating system Expired - Fee Related CN1152542C (en)

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 true CN1391386A (en) 2003-01-15
CN1152542C 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)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100390741C (en) * 2003-05-07 2008-05-28 索尼株式会社 Program processing system, program processing method, and computer program
CN102768720A (en) * 2012-03-20 2012-11-07 新奥特(北京)视频技术有限公司 Process protection method
CN107885549A (en) * 2017-11-16 2018-04-06 信阳师范学院 Remove the method and system that process is remained in TORQUE computing cluster calculate nodes
CN108279994A (en) * 2018-01-22 2018-07-13 北京仿真中心 A kind of connection Citrix has issued the automation solution of application exception
CN110147247A (en) * 2019-05-27 2019-08-20 北京智芯微电子科技有限公司 The method for realizing management software multitask based on C language
CN117055988A (en) * 2023-07-11 2023-11-14 荣耀终端有限公司 Lightweight operating system optimization processing method and electronic equipment

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100390741C (en) * 2003-05-07 2008-05-28 索尼株式会社 Program processing system, program processing method, and computer program
CN102768720A (en) * 2012-03-20 2012-11-07 新奥特(北京)视频技术有限公司 Process protection method
CN102768720B (en) * 2012-03-20 2019-02-22 新奥特(北京)视频技术有限公司 A kind of method of Process Protection
CN107885549A (en) * 2017-11-16 2018-04-06 信阳师范学院 Remove the method and system that process is remained in TORQUE computing cluster calculate nodes
CN107885549B (en) * 2017-11-16 2020-10-23 信阳师范学院 Method and system for clearing residual process in TORQUE computing cluster computing node
CN108279994A (en) * 2018-01-22 2018-07-13 北京仿真中心 A kind of connection Citrix has issued the automation solution of application exception
CN110147247A (en) * 2019-05-27 2019-08-20 北京智芯微电子科技有限公司 The method for realizing management software multitask based on C language
CN110147247B (en) * 2019-05-27 2023-01-24 北京智芯微电子科技有限公司 Method for realizing management software multitask based on C language
CN117055988A (en) * 2023-07-11 2023-11-14 荣耀终端有限公司 Lightweight operating system optimization processing method and electronic equipment
CN117055988B (en) * 2023-07-11 2024-08-02 荣耀终端有限公司 Lightweight operating system optimization processing method and electronic equipment

Also Published As

Publication number Publication date
CN1152542C (en) 2004-06-02

Similar Documents

Publication Publication Date Title
EP3607705B1 (en) Intelligent thread management across isolated network stacks
Cho et al. Graph-theoretic deadlock detection and resolution for flexible manufacturing systems
JP2583014B2 (en) Method and system for managing an environment with a data processing system
KR100733852B1 (en) Computer system
US9378060B2 (en) Runtime co-location of executing logic and frequently-accessed application data
US20060005149A1 (en) Method and system for displaying categorized information on a user interface
CN110851248B (en) Asynchronous task data processing method and device and computer readable storage medium
AU2001297946A1 (en) Computer multi-tasking via virtual threading
WO2003007105A2 (en) Computer multi-tasking via virtual threading
JPS6211956A (en) Digital data processing system and method of virtual single calculator having logic ring, message-like hardware intterupt and processor exclusion
CN104871493A (en) Communication channel failover in a high performance computing (hpc) network
EP0546663A1 (en) Computer system
US20100325643A1 (en) Integration of disparate applications on a network
US20160232037A1 (en) Latency-hiding context management for concurrent distributed tasks
SE511098C2 (en) Communication system and method for sending messages in a communication system
US7823158B2 (en) Adaptive scheduling and management of work processing in a target context in resource contention
CN104618304A (en) Data processing method and data processing system
CN1152542C (en) Method for protecting task process in multitask operating system
WO2007041777A1 (en) A database communication method
US6957427B1 (en) Remote object activation in a distributed system
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
CN1610884A (en) Entry locking for large data structures
CN100538665C (en) Multicomputer system, system board and high-speed cache replacement request disposal route
Kacmar Supporting hypermedia services in the user interface

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