CN1828542A - Implementation method for real-time task establishment in Java operating system - Google Patents

Implementation method for real-time task establishment in Java operating system Download PDF

Info

Publication number
CN1828542A
CN1828542A CN 200610050255 CN200610050255A CN1828542A CN 1828542 A CN1828542 A CN 1828542A CN 200610050255 CN200610050255 CN 200610050255 CN 200610050255 A CN200610050255 A CN 200610050255A CN 1828542 A CN1828542 A CN 1828542A
Authority
CN
China
Prior art keywords
task
tcb
control block
real
priority
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 200610050255
Other languages
Chinese (zh)
Other versions
CN100383742C (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.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
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 Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CNB2006100502554A priority Critical patent/CN100383742C/en
Publication of CN1828542A publication Critical patent/CN1828542A/en
Application granted granted Critical
Publication of CN100383742C publication Critical patent/CN100383742C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

As an important aspect to process real-time task in Java OS, the related method can not only ensure the effective process of every task to give full play to total system efficiency with available configuration, but also responses in schedule time and processes request of asynchronous event with high reliability. This invention has important meanings to embedded OS.

Description

Set up the implementation method of real-time task in the Java operating system
Technical field
The present invention relates to the real-time task treatment technology, particularly relate to the implementation method of setting up real-time task in a kind of java operating system.
Background technology
The real-time of operating system is a key character of operating system, is that real-time control computer is soft, the core of hardware system.It is born along with the formation of real-time multi-task computer system software, develops along with the raising of Real-time Multi-task System requirement.The real-time multi-task operating system that with the digital machine is the center has been brought into play important role in industry, traffic, the energy, bank, scientific research and every field such as scientific experimentation, national defence.
Real time operating system is an important branch of operating system.It should belong to the research category of operating system.The real time operating system and the general-purpose operating system have common one side, but at aspects such as function, performance, safe and secret and adaptives capacity to environment, also have the one side of its uniqueness.
Real time operating system is meant to have real-time characteristic, can support the operating system of real-time control system work, and it can organically link together the various device in the system and control them and finish set task.
The top priority of real time operating system is to utilize all available resources to finish real-time control task, secondly just is conceived to improve the service efficiency of computer system.
An important feature of real time operating system is exactly restriction and the requirement that will satisfy the time.In real-time system, time is life, and this and the general-purpose operating system have marked difference.
Except that peer machine, real time operating system all is exactly the operating system of multiprogramming.
The real-time digital control system is the main living environment and the working environment of real time operating system, and the various device of real time operating system control real-time system is finished the work jointly.
Real-time control system belongs to the research category of control system.Say that from function control system can be defined as device that energy or other medium flows etc. is regulated.
Real-time control system is a kind of environmental control system that can receive data, processing processing and result in time can be fed back.
Real-time control system is made of following four major parts:
Digital collection.It is used for collection, reception or the necessary information of input system work, or carries out input;
Processing is handled.It processes processing to the information (result who comprises input) of collection, reception or typing, draws the necessary parameter of control system work or makes decision, and exports then, writes down or show;
Operation control.The information (comprising output signal) that it is exported according to the processing treatment facility takes appropriate measures or moves, with the purpose that reaches control or conform;
Feedback processing.The execution result of its implementation and supervision mechanism, and this result is fed to input or data receiver, so that system further takes measures according to feedback, reach the intended purposes of control.
Summary of the invention
The object of the present invention is to provide real-time task scheduling method in a kind of java operating system.
The technical scheme that the present invention solves its technical matters employing is as follows:
1) Data Structures
1. task identification number
Task identification number is used for the sign task, plays the effect of task name, and its span is that 0~255, two tasks can not have identical non-zero identification number, but identification number is that zero task can have a plurality of only;
2. the state of real-time task
According to the state of task, the state of real-time task is divided into running status, ready state, suspended state, latence;
Running status: task obtains processor, moves;
Ready state: as long as obtain processor, task can be moved;
Suspended state: for a certain reason, also can't continue to carry out even task obtains processor, only remain after this kind reason cancels, task just has the right that obtains processor;
Latence: before the task creation and cancel later state;
3. the priority of real-time task
The main foundation that can the decision task selectedly put into operation when the state of task was scheduling; The precedence that ready task obtains processor is to be stipulated by the priority of task;
4. task control block (TCB)
Task control block (TCB) is the sign of task, and task system is according to task control block (TCB) and the existence of perception task, and the operand of various task call orders is exactly the task control block (TCB) of task;
Task control block (TCB) is the sole entity that the sign task exists, regained the task controls piece of task when task system after, task has just been cancelled, when setting up a new task, task system distributes the task control block (TCB) of a sky for it, and insert the relevant external characteristic information of this task, at this moment task just is present among the system; Task system is dispatched, is controlled and manage for each task, also all is that the task control block (TCB) according to each task carries out;
5. task control block (TCB) formation
By the task executions situation, according to the priority of task task control block (TCB) is organized into three kinds of task control block (TCB) formations: activity queue, ready queue, empty queue;
2) real-time task establishment step
Mainly finish and set up a new task in multitask system, after whole user job was input to system, system thought to have only a task, be that the first to be appointed to an office is engaged in, other tasks must be engaged in setting up new task by the first to be appointed to an office, during by the task creation order, can set up a Real-time Multi-task System;
Step is as follows:
(1) closes interruption
(2) whether the identification number of all task control block (TCB)s is identical with will setting up of task in the inspection ready queue, identical then execution (4), otherwise carry out (3);
(3) scan empty formation has judged whether the sky task control block (TCB), if free task control block (TCB) is arranged, carries out (5), does not then provide error message, withdraws from;
(4) whether the identification number of judging task control block (TCB) for being 0, if 0, then carry out (3), continue to search empty task piece, if not 0, then provide error message, withdraw from;
(5) take off this formation and readjust empty queue from empty queue;
(6) field data of will setting up of task, surface information and control and management information are inserted this idle task controll block;
(7) scan ready queue, compare the height of priority with it
(8) priority height is just got the previous task control block (TCB) of ready queue, carries out (7), relatively the height of priority;
(9) priority is low, and just the task control block (TCB) with this task is suspended in the ready queue, and adjusts formation;
(10) open interruption and end.
The beneficial effect that the present invention has is: realize simple, system overhead is little, less system response time, give full play to the efficient of whole resources, utilize the existing configuration of operating system, the utilization factor of the resource of operating system is improved as far as possible, improve running efficiency of system, to the information configuration of real-time task controll block, make real-time task can be in the response time of regulation response and handle the request of asynchronous event, height reliability.Provide effective guarantee to later stage operating system to the timely processing of real-time task.
Description of drawings
The formation of Fig. 1 task control block (TCB);
Fig. 2 sets up the real-time task process flow diagram.
Embodiment
When implementing to set up real-time task, concrete mode is as follows:
1) Data Structures
1. task identification number
Task identification number is used for the sign task, plays the effect of task name, and its span is that 0~255, two tasks can not have identical non-zero identification number, but identification number is that zero task can have a plurality of only;
2. the state of real-time task
Running status: task obtains processor, moves;
Ready state: as long as obtain processor, task can be moved;
Suspended state: for a certain reason, also can't continue to carry out even task obtains processor, only remain after this kind reason cancels, task just has the right that obtains processor;
Latence: before the task creation and cancel later state;
3. the priority of real-time task
The main foundation that can the decision task selectedly put into operation when the state of task was scheduling; The precedence that ready task obtains processor is to be stipulated by the priority of task;
The priority of task has reflected that it seeks out the eager degree of its execution result.Generally speaking, task dispatch is always selected the highest task run of priority.The task priority scope is 0~255, and wherein 0 priority is for the highest, and different task can have identical priority.When creating a task, must specify its priority.If do not specify, the priority that system just gets current task automatically is the priority of new task.
4. task control block (TCB)
Task control block (TCB) is the sign of task, and task system is according to task control block (TCB) and the existence of perception task, and the operand of various task call orders is exactly the task control block (TCB) of task;
Task control block (TCB) is the sole entity that the sign task exists, regained the task controls piece of task when task system after, task has just been cancelled, when setting up a new task, task system distributes the task control block (TCB) of a sky for it, and insert the relevant external characteristic information of this task, at this moment task just is present among the system; Task system is dispatched, is controlled and manage for each task, also all is that the task control block (TCB) according to each task carries out;
Task control block (TCB) also is the comunication area of user task and operating system exchange message.When user task to system's application system resource, during as stored district, input-output device, need the content that relevant application is asked is inserted among the task control block (TCB).And then submit to system, and system also is the task control block (TCB) of relevant return message being sent into task, and obtains information by task from task control block (TCB) after some application of finishing user's proposition or operation.
The main contents of task control block (TCB) comprise the operation field data of user task, and three parts for information about of the external characteristic information of task itself and management role controll block are as follows:
Field data: the content of each register or totalizer in the preservation user task operation field data, the content of preserving the user task programmable counter;
Task surface information: user task identification number, user task state, user task priority;
Managing control information: task call command word, task and system communication area, task control block (TCB) connective word.
5. task control block (TCB) formation
By the task executions situation, task control block (TCB) is organized into three kinds of task control block (TCB) formations according to the priority of task: activity queue, ready queue, empty queue, as shown in Figure 1.
Number of tasks in the user job is specified by the user, and system's linkage editor comes allocating task controll block space according to number of tasks.
Ready queue: the task control block (TCB) that will be in all tasks of ready, suspended state conspires to create a chain by means of the connective word in the task control block (TCB), each task task control block (TCB) is that the task control block (TCB) of equal priority is then arranged by task creation precedence by low tactic in the high earlier back of the priority of task.
Operation queue: the task control block (TCB) that will be in all tasks of running status conspires to create a chain by means of the connective word in the task control block (TCB), each task task control block (TCB) is that the task control block (TCB) of equal priority is then arranged by task creation precedence by low tactic in the high earlier back of the priority of task.
Empty queue: all idle task controll blocks generally also conspire to create a chain.
The first address of individual queue generally is stored in the job control table of user job.
2) real-time task establishment step
Mainly finish and set up a new task in multitask system, after whole user job was input to system, system thought to have only a task, and promptly the first to be appointed to an office is engaged in, and other tasks must be set up new task by first to be appointed to an office affair.During by the task creation order, can set up a Real-time Multi-task System.
After an operation submit operation system, operating system is closed interruption, the scanning ready queue, whether the identification number of checking the task control block (TCB) in the ready queue is identical with will setting up of task, if in ready queue, do not find same identification number, perhaps identical task number equals 0, so just from the task chain of sky, pick out the task control block (TCB) of a sky, the field data of will setting up of task, surface information and control and management information are inserted this idle task controll block, the scanning ready queue, priority of disposing order finds the position of this task control block (TCB) in proper order, inserts this task control block (TCB) in ready queue, open interruption, withdraw from.
As shown in Figure 2, concrete steps are as follows:
(1) closes interruption
This program is worked under the blockade interruption status, because task control block (TCB) is the operand of program in the ready queue, information does not allow to carry out changing in the process in scheduling in each controll block, so the program that enters is blocked interruption immediately, can not interrupted in the assurance multi-task scheduling program process;
(2) whether the identification number of all task control block (TCB)s is identical with will setting up of task in the inspection ready queue, identical then execution (4), otherwise carry out (3);
(3) scan empty formation has judged whether the sky task control block (TCB), if free task control block (TCB) is arranged, carries out (5), does not then provide error message, withdraws from;
(4) whether the identification number of judging task control block (TCB) for being 0, if 0, then carry out (3), continue to search empty task piece, if not 0, then provide error message, withdraw from;
(5) take off this formation and readjust empty queue from empty queue;
(6) field data of will setting up of task, surface information and control and management information are inserted this idle task controll block;
(7) scan ready queue, compare the height of priority with it;
(8) priority height is just got the previous task control block (TCB) of ready queue, carries out (7), relatively the height of priority;
(9) priority is low, and just the task control block (TCB) with this task is suspended in the ready queue, and adjusts formation;
(10) open interruption and end.

Claims (1)

1. set up the implementation method of real-time task in the java operating system, it is characterized in that:
1) Data Structures
1. task identification number
Task identification number is used for the sign task, plays the effect of task name, and its span is that 0~255, two tasks can not have identical non-zero identification number, but identification number is that zero task can have a plurality of only;
2. the state of real-time task
According to the state of task, the state of real-time task is divided into running status, ready state, suspended state, latence;
Running status: task obtains processor, moves;
Ready state: as long as obtain processor, task can be moved;
Suspended state: for a certain reason, also can't continue to carry out even task obtains processor, only remain after this kind reason cancels, task just has the right that obtains processor;
Latence: before the task creation and cancel later state;
3. the priority of real-time task
The main foundation that can the decision task selectedly put into operation when the state of task was scheduling; The precedence that ready task obtains processor is to be stipulated by the priority of task;
4. task control block (TCB)
Task control block (TCB) is the sign of task, and task system is according to task control block (TCB) and the existence of perception task, and the operand of various task call orders is exactly the task control block (TCB) of task;
Task control block (TCB) is the sole entity that the sign task exists, regained the task controls piece of task when task system after, task has just been cancelled, when setting up a new task, task system distributes the task control block (TCB) of a sky for it, and insert the relevant external characteristic information of this task, at this moment task just is present among the system; Task system is dispatched, is controlled and manage for each task, also all is that the task control block (TCB) according to each task carries out;
5. task control block (TCB) formation
By the task executions situation, according to the priority of task task control block (TCB) is organized into three kinds of task control block (TCB) formations: activity queue, ready queue, empty queue;
2) real-time task establishment step
Mainly finish and set up a new task in multitask system, after whole user job was input to system, system thought to have only a task, be that the first to be appointed to an office is engaged in, other tasks must be engaged in setting up new task by the first to be appointed to an office, during by the task creation order, can set up a Real-time Multi-task System;
Step is as follows:
(1) closes interruption
(2) whether the identification number of all task control block (TCB)s is identical with will setting up of task in the inspection ready queue, identical then execution (4), otherwise carry out (3);
(3) scan empty formation has judged whether the sky task control block (TCB), if free task control block (TCB) is arranged, carries out (5), does not then provide error message, withdraws from;
(4) whether the identification number of judging task control block (TCB) for being 0, if 0, then carry out (3), continue to search empty task piece, if not 0, then provide error message, withdraw from;
(5) take off this formation and readjust empty queue from empty queue;
(6) field data of will setting up of task, surface information and control and management information are inserted this idle task controll block;
(7) scan ready queue, compare the height of priority with it
(8) priority height is just got the previous task control block (TCB) of ready queue, carries out (7), relatively the height of priority;
(9) priority is low, and just the task control block (TCB) with this task is suspended in the ready queue, and adjusts formation;
(10) open interruption and end.
CNB2006100502554A 2006-04-07 2006-04-07 Implementation method for real-time task establishment in Java operating system Expired - Fee Related CN100383742C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100502554A CN100383742C (en) 2006-04-07 2006-04-07 Implementation method for real-time task establishment in Java operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100502554A CN100383742C (en) 2006-04-07 2006-04-07 Implementation method for real-time task establishment in Java operating system

Publications (2)

Publication Number Publication Date
CN1828542A true CN1828542A (en) 2006-09-06
CN100383742C CN100383742C (en) 2008-04-23

Family

ID=36946953

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100502554A Expired - Fee Related CN100383742C (en) 2006-04-07 2006-04-07 Implementation method for real-time task establishment in Java operating system

Country Status (1)

Country Link
CN (1) CN100383742C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844370A (en) * 2016-09-19 2018-03-27 杭州海康威视数字技术股份有限公司 A kind of real-time task scheduling method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2740469B2 (en) * 1995-05-31 1998-04-15 日本電気アイシーマイコンシステム株式会社 Task management method
EP1405171A4 (en) * 2001-06-04 2005-08-24 Radisys Corp Method and apparatus to use task priority to scale processor performance
CN100485605C (en) * 2001-09-24 2009-05-06 中兴通讯股份有限公司 Realizing method for multiple task real-time operation system
US20050015767A1 (en) * 2003-07-01 2005-01-20 Brian Nash Operating system configuration tool
CN1317640C (en) * 2004-08-31 2007-05-23 华为技术有限公司 Multi-task application software module management method in real-time operating system environment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844370A (en) * 2016-09-19 2018-03-27 杭州海康威视数字技术股份有限公司 A kind of real-time task scheduling method and device
CN107844370B (en) * 2016-09-19 2020-04-17 杭州海康威视数字技术股份有限公司 Real-time task scheduling method and device

Also Published As

Publication number Publication date
CN100383742C (en) 2008-04-23

Similar Documents

Publication Publication Date Title
CN1828541A (en) Implementation method for timing task in Java operating system
CN100342342C (en) Java virtual machine implementation method supporting multi-process
CN100346307C (en) Method of real time task regulation in Java operation system
CN1908903A (en) System and method for executing job step, and computer product
CN1306754C (en) Method and system for balancing working load in network computing environment
CN1152304C (en) Method and apparatus for concurrent data processing
CN1154928C (en) Resource management method and apparatus for information processing system of multitasking facility
CN1516419A (en) Syste mand method for processing customer computer request on host computer network
CN101038559A (en) Batch task scheduling engine and dispatching method
CN100347675C (en) Property optimizing method for applying server
CN1008484B (en) Processor i/o and interrupt filters
CN1818875A (en) Grouped hard realtime task dispatching method of built-in operation system
CN101079902A (en) A great magnitude of data hierarchical storage method
CN1897025A (en) Parallel ETL technology of multi-thread working pack in mass data process
CN101055535A (en) Parallel computer and method for locating hardware faults in a parallel computer
CN1828543A (en) Real-time task scheduling method in Java operating system
CN1752896A (en) Power source management method of embedded equipment under operation system cooperation and its system
CN1889045A (en) Cocurrent event processing device and method in multi-task software system
CN1744046A (en) Multi-task application software module management method in real-time operating system environment
CN1737764A (en) Task scheduling method for embedded real-time operation system supporting OSEK standard
CN1423456A (en) Sharing route realizing and sheduling method
CN103677959A (en) Virtual machine cluster migration method and system based on multicast
CN1828542A (en) Implementation method for real-time task establishment in Java operating system
CN1519735A (en) Process scheduling method in embedded type real time operating system
CN1858699A (en) Software subsystem of electronic information system

Legal Events

Date Code Title Description
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: 20080423

Termination date: 20120407