CN102023895A - Singlechip programming method with priority task switching - Google Patents

Singlechip programming method with priority task switching Download PDF

Info

Publication number
CN102023895A
CN102023895A CN2010105713153A CN201010571315A CN102023895A CN 102023895 A CN102023895 A CN 102023895A CN 2010105713153 A CN2010105713153 A CN 2010105713153A CN 201010571315 A CN201010571315 A CN 201010571315A CN 102023895 A CN102023895 A CN 102023895A
Authority
CN
China
Prior art keywords
task
priority
tasks
query
execution
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.)
Pending
Application number
CN2010105713153A
Other languages
Chinese (zh)
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.)
Guangdong Yada Electric Co Ltd
Original Assignee
Guangdong Yada Electric 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 Guangdong Yada Electric Co Ltd filed Critical Guangdong Yada Electric Co Ltd
Priority to CN2010105713153A priority Critical patent/CN102023895A/en
Publication of CN102023895A publication Critical patent/CN102023895A/en
Pending legal-status Critical Current

Links

Abstract

The invention relates to a singlechip programming method with priority task switching, comprising the following steps: (1) each task in a system is set into the task with a corresponding unique priority, and all tasks in the system act on one stack jointly; (2) all the tasks in the system are stored in a task priority queue; (3) the task priority queue is inquired, the task with the highest priority in the task priority queue is chosen to be executed; (4) after the current task is executed, the tasks in the task priority queue are re-inquired, and the task with the highest priority is executed; and (5) the execution of the current task can not be interrupted by the task with higher priority in the task execution process. According to the invention, the response time of the task with the highest priority is improved, the system is simple, and less resource is occupied.

Description

A kind of mcu programming method with priority tasks switching
Technical field
The present invention relates to a kind of programmed method of single-chip microcomputer, relate in particular to a kind of mcu programming method that priority tasks is switched that has.
Background technology
The programming mode of single-chip microcomputer mainly is single task process operation and real-time multi-task operating system at present.All tasks all are the pipeline system operations in the single task process operation system, and all tasks all are same priority, will produce time-delay to hot job, owing to do not switch between the task, total system only needs a storehouse; All tasks all are that the limit priority mode is operated in the real-time multi-task operating system, all tasks all have different priority, task in the process of implementation, if there is the higher priority task to take place, the higher priority task will be seized execution, because between the task switching is arranged, each task all has an independently storehouse, causes system complex and take resource many.
Summary of the invention
The technical problem to be solved in the present invention provides a kind of response time of improving high-priority task, and system is simple, takies the few mcu programming method with priority tasks switching of resource.
In order to solve the problems of the technologies described above, the present invention takes following technical scheme:
A kind of mcu programming method with priority tasks switching may further comprise the steps:
(1) each task in the system all is arranged to have corresponding unique priority, and all tasks in the system makes storehouse of effect jointly;
(2) all tasks in the system are all left in the task priority formation;
(3) query task priority query selects the limit priority task in the task priority formation to carry out;
(4) current task complete after, the task in the query task priority query again, and the limit priority task carried out.
(5) in the task implementation, the higher priority task can not be interrupted existing task execution.
The priority of each task is maintained fixed in the described step (2).
In the process that described step (3) is executed the task, being in the priority query of task all keeps waiting status.
The present invention is by being arranged to all tasks a shared storehouse, and being in system's operational process in the task queue of task all keeps original task priority, system is oversimplified, and in the process of executing the task, the task of other higher priority keeps waiting status can not seize execution, and it is few to take resource.
Embodiment
For the ease of those skilled in the art's understanding, the invention will be further described below in conjunction with specific embodiment.
A kind of mcu programming method with priority tasks switching may further comprise the steps:
(1) each task in the system all is arranged to have corresponding unique priority, and all tasks in the system makes storehouse of effect jointly;
(2) all tasks in the system are all left in the task priority formation;
(3) query task priority query selects the limit priority task in the task priority formation to carry out;
(4) current task complete after, the task in the query task priority query again, and the limit priority task carried out.
Wherein, the priority of each task is maintained fixed constantly in the step (2), can not revise the original priority of each task, and in the process that step (3) is executed the task, being in the priority query of task all keeps waiting status, all can not seize execution.All tasks are all waken up by incident or clock source.
During concrete the execution, task priority is listed as follows:
?Bit0 Bit1 ?Bit2 。。。
Task names Task A Task B Task C 。。
Priority level 0 1 2 。。
Ready status word 0 1 0 。。
The more little expression priority of priority level data is high more.During beginning, all have task all to leave in the task priority team in the system, because storehouse of the common use of all tasks, therefore, system is simpler, at first selects the highest task of priority level to carry out when executing the task, and other tasks are maintained fixed constant, and in the process of executing the task, other tasks can not be seized execution.After current task was complete, by query task formation again, the limit priority task was carried out in the selection task queue.When ready status word is 1, represent that this task dispatching is pending, after task is complete, remove corresponding ready status word.

Claims (3)

1. one kind has the mcu programming method that priority tasks is switched, and may further comprise the steps:
(1) each task in the system all is arranged to have corresponding unique priority, and all tasks in the system makes storehouse of effect jointly;
(2) all tasks in the system are all left in the task priority formation;
(3) query task priority query selects the limit priority task in the task priority formation to carry out;
(4) current task complete after, the task in the query task priority query again, and the limit priority task carried out;
(5) in the task implementation, the higher priority task can not be interrupted existing task execution.
2. the mcu programming method with priority tasks switching according to claim 1, it is characterized in that: the priority of each task is maintained fixed in the described step (2).
3. the mcu programming method with priority tasks switching according to claim 2, it is characterized in that: in the process that described step (3) is executed the task, being in the priority query of task all keeps waiting status.
CN2010105713153A 2010-11-25 2010-11-25 Singlechip programming method with priority task switching Pending CN102023895A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010105713153A CN102023895A (en) 2010-11-25 2010-11-25 Singlechip programming method with priority task switching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010105713153A CN102023895A (en) 2010-11-25 2010-11-25 Singlechip programming method with priority task switching

Publications (1)

Publication Number Publication Date
CN102023895A true CN102023895A (en) 2011-04-20

Family

ID=43865217

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010105713153A Pending CN102023895A (en) 2010-11-25 2010-11-25 Singlechip programming method with priority task switching

Country Status (1)

Country Link
CN (1) CN102023895A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105786605A (en) * 2016-03-02 2016-07-20 中国科学院自动化研究所 Task management method and system in robot
CN108255589A (en) * 2017-08-29 2018-07-06 平安科技(深圳)有限公司 Method for scheduling task and server
CN109308212A (en) * 2017-07-26 2019-02-05 上海华为技术有限公司 A kind of task processing method, task processor and task processing equipment
CN112318484A (en) * 2020-12-15 2021-02-05 苏州光格设备有限公司 Task scheduling method for track inspection robot

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101290509A (en) * 2007-04-19 2008-10-22 中兴通讯股份有限公司 Embedded system low-power consumption real time task scheduling method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101290509A (en) * 2007-04-19 2008-10-22 中兴通讯股份有限公司 Embedded system low-power consumption real time task scheduling method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王保进; 李明树; 王志刚: "Alpha OSEK:一个基于OSEK/VDX标准实现的嵌入式实时操作系统", 《计算机工程与应用》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105786605A (en) * 2016-03-02 2016-07-20 中国科学院自动化研究所 Task management method and system in robot
CN109308212A (en) * 2017-07-26 2019-02-05 上海华为技术有限公司 A kind of task processing method, task processor and task processing equipment
CN108255589A (en) * 2017-08-29 2018-07-06 平安科技(深圳)有限公司 Method for scheduling task and server
CN112318484A (en) * 2020-12-15 2021-02-05 苏州光格设备有限公司 Task scheduling method for track inspection robot

Similar Documents

Publication Publication Date Title
CN102541640B (en) Cluster GPU (graphic processing unit) resource scheduling system and method
CN101258469B (en) Information processing device
US9880875B2 (en) Apparatus and method for hardware-based task scheduling
CN102023895A (en) Singlechip programming method with priority task switching
CN104536827B (en) A kind of data dispatching method and device
CN101719080B (en) Multi-core timer implementing method and system
CN102043667A (en) Task scheduling method for embedded operating system
CN102222022A (en) Real-time task scheduling method based on multicore processor
CN103823719A (en) Distributed cloud computing system and distributed cloud computing method for executable program
WO2018126771A1 (en) Storage controller and io request processing method
CN1794183A (en) Method of real time task regulation in Java operation system
CN103336684A (en) AC capable of concurrent processing AP information and processing method thereof
CN102855156A (en) Interrupt controller and interrupt controlling method
CN105607956A (en) Task allocation method and system in computer
CN103309734A (en) Embedded task scheduling method based on priority grouping
CN105446812A (en) Multitask scheduling configuration method
CN101158849A (en) Method for preventing industrial automation system from snowslip
CN105874426B (en) A kind of batch processing method and device of system call command
CN102141938B (en) Method and device for adjusting software load in multithreaded system
CN106155786A (en) A kind of cloud platform task management method and system
CN105260239B (en) One kind being used for fault detector functional performance equalization scheduling method
CN101290591A (en) Embedded operating system task switching method and unit
CN104461471A (en) Unified instruction scheduling and register allocating method on clustering VLIW processor
CN105629873A (en) Hybrid task scheduling method suitable for numerical control system
CN102163163A (en) Small node operating system and implementation method thereof for wireless sensor network

Legal Events

Date Code Title Description
PB01 Publication
C06 Publication
SE01 Entry into force of request for substantive examination
C10 Entry into substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20110420

C12 Rejection of a patent application after its publication