CN102200929A - Method for processing asynchronous communication among tasks and system for processing multi-task asynchronous communication - Google Patents
Method for processing asynchronous communication among tasks and system for processing multi-task asynchronous communication Download PDFInfo
- Publication number
- CN102200929A CN102200929A CN 201010133268 CN201010133268A CN102200929A CN 102200929 A CN102200929 A CN 102200929A CN 201010133268 CN201010133268 CN 201010133268 CN 201010133268 A CN201010133268 A CN 201010133268A CN 102200929 A CN102200929 A CN 102200929A
- Authority
- CN
- China
- Prior art keywords
- task
- information structure
- notified
- module
- main process
- 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
Links
Images
Abstract
The invention relates to a method for realizing multi-task communication under an embedded real-time operating system. The invention provides the method for processing asynchronous communication in order to avoid mutual influence among tasks and a system for processing multi-task asynchronous communication. A main flow of a notification task stores information into an external information structure of a notified task; the external information structure of the notified task is only used for storing the information which is transmitted by the notification task in allusion to the notified task; the main flow of the notified task reads the external information structure of the notified task and stores the information in the external information structure into an internal information structure; and the main flow of the notified task implements and processes the information in the internal information structure. According to the invention, the information interaction among tasks is ensured to be timely and accurate, the coupling among task modules is reduced, and the system is more stable and reliable.
Description
Technical field
The present invention relates to the multitask realization of Communication method of computer program, particularly multitask realization of Communication method under the embedded real-time operating system.
Background technology
Under the multitask system of a complexity, need more mutual necessary information between the task in computer communication field, this relates to the communication technology between task.The task information interaction adopts asynchronous processing mode such as memory shared, socket modes such as (sockets) usually.Independently take any mode all to have the defective on some performance or increased the complicacy that realizes etc.Such as adopting socket communication, need to set up the message bag that socket connects and definition is communicated by letter between the task, this realizes too complicated in some system.Adopt the mode of memory shared, have the read-write protection problem to shared drive, can reduce the real-time of task, influence performance, exigent system also is not suitable for for real-time.Asynchronous information between task is mutual, relates to the operations such as protection of task to public resource, deals with improperly and often causes between task coupling big, and the abnormality of a task can cause other associated tasks problems such as unusual to occur blocking; Perhaps the running status of a task can influence the running status of another one task, when operating public resource, causes the another one task to wait as long for because can not get the operating right of public resource such as a task; Perhaps occur because a plurality of tasks cause public resource destroyed to the visit of same public resource; Perhaps appearance causes serious situations such as deadlock owing to the inappropriate protection to public resource, causes harmful effect for the stable operation of system.
So, the actual mechanism of asynchronous communication between a cover task is provided, the coupling between the reduction task, relevance are very important.
Summary of the invention
Technical matters to be solved by this invention is to overcome above the deficiencies in the prior art, and disposal route and the multitask asynchronous communication disposal system of avoiding interactional asynchronous communication between task are provided.
The present invention solves the problems of the technologies described above the technical scheme that is adopted to be, the disposal route of asynchronous communication may further comprise the steps between task;
The main process of a, notice task with information stores to the external information structure of notified task; The external information structure of described notified task only is used to store the information that the notice task sends at this notified task;
The main process of b, notified task reads its external information structure, with the information unloading in the external information structure to the internal information structure;
The information in the internal information structure is carried out, handled to the main process of c, notified task.
The interoperability of notified task and notice task only is confined in the read-write to the external information structure of notified task, and the main process of not related task separately and internal information structure have reduced influencing each other between task; Because the information that does not relate to a plurality of so notified tasks of similar memory shared is stored in the situation of a physical memory, has avoided multitask to the inappropriate visit of public resource.Main process is not handled information when reading the external information module immediately, but earlier with the information unloading to the internal information structure, reduce visit holding time to public external information result.
Concrete, step a may further comprise the steps:
The main process of a1, notice task obtains the access rights of the external information structure of notified task;
The main process of a2, notice task is stored to information package in the message queue of external information structure of notified task successively;
The main process that the main process of a3, notice task adopts the arouse machine processed of notified task correspondence to wake notified task up is handled the external information structure;
The main process of a4, notice task discharges the access rights of the external information structure of notified task.
Concrete, step b may further comprise the steps:
The main process of b1, notified task obtains the external information structure of notified task and the access rights of internal information structure;
The main process of b2, notified task takes out information and unloading successively to the internal information structure of notified task from the message queue of its external information structure;
The main process of b3, notified task discharges the access rights of its external information structure and internal information structure.
Concrete, the external information structure belongs to the public resource of multi-job operation, needs to adopt effective read-write protection mechanism, and any suitable protection mechanism that can the employing system provides such as semaphore, is interrupted lock.
Information storage means in the external information structure, any storage mode that can the employing system provides, such as First Input First Output, dynamic link table.
Task arouse machine processed in the external information structure, any suitable arouse machine processed that can the employing system provides.
The task arouse machine processed of external information structure, any task arouse machine processed that can adopt operating system to provide is such as discharging communication binary signal amount, pipeline communication.
For realizing said method, the present invention also provides a kind of multitask asynchronous communication disposal system, comprise some task modules, described task module comprises the main process processing unit, include the internal information structure in the described main process processing unit, described task module comprises and also comprises the external information structure that described external information structure is independent of the main process processing unit;
Described external information structure is used to store the information that other task module is notified;
Described main process processing unit when being used for task module when its place as notified task module, reads its external information structure, and the information in the internal information structure is carried out, handled to the information unloading in the external information structure to the internal information structure; When the task module at its place during as the notice task module, with information stores to the external information structure of notified task;
Described internal information structure is used for storing the information from the unloading of external information structure, reads for the main process processing unit.
Further, described external treatment structure comprises message queue module, read-write protection module, wake module;
Described message queue module is used to store the information that other task module is notified;
Described read-write protection module is used for when the message queue module is acquired access rights read-write protection being carried out in message queue; When the message queue module was released access rights, cancellation was carried out read-write protection to message queue;
Described wake module is used for waking up the information of main process processing unit processes message queue module.
The invention has the beneficial effects as follows, guaranteed the task information interaction promptly and accurately, reduce the coupling between the task module, make system more reliable and more stable.
Description of drawings
The information interaction synoptic diagram of Fig. 1 task module B and task module A.
Embodiment
Below in conjunction with embodiment, describe technical scheme of the present invention in detail.
Each task is isolated the general external information structure of a cover separately, and the information interaction between task mainly by the processing to outside message structure, does not relate to the main process of task and the internal information structure of task.In the multitask asynchronous communication disposal system, when task module A as notified task module, task module B is as the notice task module, task module A is identical with the structure of task module B, comprise main process processing unit, external information structure, include the internal information structure in the described main process processing unit, the external information structure is independent of the main process processing unit.The information stores that the main process processing unit need be handled is to the internal information structure.The outside interactive information that the external information structure provides.As shown in Figure 1, the task module A as notified task module deposits information (1) by its main process processing unit in earlier in the external information structure as the task module B that notifies task module; The main process processing unit of task module B is with the information unloading in the external information structure of task module B (2) in the internal information structure; The main process processing unit of task module B reads the information (3) in the internal information structure, thereby realized the information interaction between two task modules.
Task module B is as follows to the concrete implementation step of task module A announcement information:
1. task module A provides its external information structure:
Task module A belongs to notified task module.The external information structure comprises three ingredients: the message queue module of storage external tasks module announcement information, such as First Input First Output; To the read-write protection module that the message queue module conducts interviews and controls, the read-write protection module can adopt mutex amount mechanism; The body that triggers task module A is handled the wake module of external information structure, and wake module can adopt pipeline mechanism.
2. the external information structure of operation task modules A when task module B notifies task module A:
The notice flow process mainly comprises four flow processs:
Task module B gets the access rights of the external information structure of access task modules A;
Task module B stores information package in the external information structure of task module A;
Task module B adopts the arouse machine processed of task module A to wake its external information structure of task module A asynchronous process up;
Task module B discharges the access rights of the external information structure of task module A.
3. task module A is the information translation in its external information structure a information in the internal information structure:
After task module A is waken up, the external information that receives need be converted to internal information, mainly comprise five flow processs in the main process processing module of task modules A:
Task module A gets the access rights of its internal information structure, such as the internal signal amount of getting the internal information structure;
Task module A gets the access rights of its external information structure, such as the semaphore of getting the external information structure;
Task module A takes out the information node that is stored in the message queue module successively, and unloading is in internal information formation module;
Task module A discharges the access rights of its external information structure, such as the external signal amount that discharges task A;
Task module A discharges the access rights of its internal information structure, such as the internal signal amount that discharges task A.
4. the internal information after the main process processing module asynchronous process of task module A is changed:
Information unloading in the external information structure of task module A after the internal information structure, the information of the main process of task module A in just can asynchronous process internal information structure.
In the whole communication process, there is not any direct correlation relation in the main process of task module A and task module B.Task module B has incident to produce when needing to notify task module A, only get access to the operating right of the external information structure of task module A, the internal information structure of inoperation task module A does not promptly need to get access to the access rights of the internal information structure in the task module A main flow processing unit.
Task module A has an external event conversion sub-process, need get access to the operating right of task A main process processing unit, such as getting access to the internal signal amount, the operating right that needs the of short duration task that gets access to A external information structure simultaneously, such as the external signal amount, finish the internal information structure that the content of external information structure is converted to task A.The internal information structure belongs to the part of task A main process processing unit.Here just conversion is not handled the internal information structure after the conversion immediately.Reduced access time to public external information structure.The main flow of task A is handled, and does not relate to the external information structure of operation task A, does not need to get the external information structure operation authority of task A.Task A only obtains the operating right of task main process processing unit, the internal information structure after the conversion is handled, i.e. the information of asynchronous process task B notice.
Claims (8)
1. the disposal route of asynchronous communication between task is characterized in that, may further comprise the steps;
The main process of a, notice task with information stores to the external information structure of notified task; Described external information structure only is used to store the information that the notice task sends at this notified task;
The main process of b, notified task reads the information of its external information structure, and unloading is to its internal information structure;
The information in the internal information structure is carried out, handled to the main process of c, notified task.
2. the disposal route of asynchronous communication between task according to claim 1 is characterized in that step a comprises:
The main process of a1, notice task obtains the access rights of the external information structure of notified task;
The main process of a2, notice task is stored to information package in the message queue of external information structure of notified task successively;
The main process that the main process of a3, notice task adopts the arouse machine processed of notified task correspondence to trigger notified task is handled the external information structure;
The main process of a4, notice task discharges the access rights of the external information structure of notified task.
3. as the disposal route of asynchronous communication between task as described in the claim 2, it is characterized in that described arouse machine processed is realized by discharging communication binary signal amount or pipeline communication.
4. the disposal route of asynchronous communication between task according to claim 1 is characterized in that step b comprises:
The main process of b1, notified task obtains the external information structure of notified task and the access rights of internal information structure;
The main process of b2, notified task takes out information and unloading successively to the internal information structure of notified task from the message queue of its external information structure;
The main process of b3, notified task discharges the access rights of its external information structure and internal information structure.
5. as the disposal route of asynchronous communication between task as described in claim 2 or 4, it is characterized in that, the control of access rights is adopted Semaphore Mechanism or interrupted lock mechanism.
6. as the disposal route of asynchronous communication between task as described in claim 2 or 4, it is characterized in that the information stores in the external information structure adopts First Input First Output mechanism or dynamic link table mechanism.
7. multitask asynchronous communication disposal system, at least comprise 2 task modules, described task module comprises the main process processing unit, include the internal information structure in the described main process processing unit, it is characterized in that, described task module also comprises the external information structure, and described external information structure is independent of the main process processing unit;
Described external information structure is used to store the information that other task module is notified;
Described main process processing unit, when the task module at its place during as notified task module, be used for reading the external information structure and with the information unloading of external information structure to the internal information structure, carry out, handle the information in the internal information structure; When the task module at its place during, be used for the external information structure of information stores to notified task as the notice task module;
Described internal information structure is used for storing the information from the unloading of external information structure, reads for the main process processing unit.
8. as multitask asynchronous communication disposal system as described in the claim 7, described external treatment structure comprises message queue module, read-write protection module, wake module;
Described message queue module is used to store the information that other task module is notified;
Described read-write protection module is used for when the message queue module is acquired access rights read-write protection being carried out in message queue; When the message queue module was released access rights, cancellation was carried out read-write protection to message queue;
Described wake module is used for waking up the information of main process processing unit processes message queue module.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201010133268 CN102200929A (en) | 2010-03-26 | 2010-03-26 | Method for processing asynchronous communication among tasks and system for processing multi-task asynchronous communication |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201010133268 CN102200929A (en) | 2010-03-26 | 2010-03-26 | Method for processing asynchronous communication among tasks and system for processing multi-task asynchronous communication |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102200929A true CN102200929A (en) | 2011-09-28 |
Family
ID=44661622
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 201010133268 Pending CN102200929A (en) | 2010-03-26 | 2010-03-26 | Method for processing asynchronous communication among tasks and system for processing multi-task asynchronous communication |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102200929A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102647344A (en) * | 2012-03-30 | 2012-08-22 | 迈普通信技术股份有限公司 | Message sending method in embedded and distributed system |
CN102664947A (en) * | 2012-04-18 | 2012-09-12 | 迈普通信技术股份有限公司 | Notification distribution method for distributed system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0472829A2 (en) * | 1990-08-31 | 1992-03-04 | International Business Machines Corporation | Multicomputer complex and distributed shared data memory |
CN1534504A (en) * | 2003-03-31 | 2004-10-06 | �ձ�������ʽ���� | Paralled processing system using single processor operating system and parallel processing program |
CN101198950A (en) * | 2005-06-13 | 2008-06-11 | 奥林巴斯株式会社 | Distributed processing system, distributed processing method, and computer program |
CN101262352A (en) * | 2008-03-04 | 2008-09-10 | 浙江大学 | Uniform data accelerated processing method in integrated secure management |
-
2010
- 2010-03-26 CN CN 201010133268 patent/CN102200929A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0472829A2 (en) * | 1990-08-31 | 1992-03-04 | International Business Machines Corporation | Multicomputer complex and distributed shared data memory |
CN1534504A (en) * | 2003-03-31 | 2004-10-06 | �ձ�������ʽ���� | Paralled processing system using single processor operating system and parallel processing program |
CN101198950A (en) * | 2005-06-13 | 2008-06-11 | 奥林巴斯株式会社 | Distributed processing system, distributed processing method, and computer program |
CN101262352A (en) * | 2008-03-04 | 2008-09-10 | 浙江大学 | Uniform data accelerated processing method in integrated secure management |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102647344A (en) * | 2012-03-30 | 2012-08-22 | 迈普通信技术股份有限公司 | Message sending method in embedded and distributed system |
CN102664947A (en) * | 2012-04-18 | 2012-09-12 | 迈普通信技术股份有限公司 | Notification distribution method for distributed system |
CN102664947B (en) * | 2012-04-18 | 2015-11-04 | 迈普通信技术股份有限公司 | Notice distribution method in distributed system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9965014B2 (en) | Techniques for tracing wakelock usage | |
CN102077181B (en) | Method and system for generating and delivering inter-processor interrupts in a multi-core processor and in certain shared-memory multi-processor systems | |
US20120030330A1 (en) | System for managing wakeup and sleep events of computers connected to a motor vehicle can network | |
US8566493B2 (en) | Interrupt controller and methods of operation | |
CN102270189B (en) | Inter-core communication method based on FPGA (Field Programmable Gate Array) multi-core system | |
CN101464811A (en) | Multitask monitoring management system | |
CN102929834B (en) | The method of many-core processor and intercore communication thereof, main core and from core | |
CN101013415A (en) | Thread aware distributed software system for a multi-processor array | |
DE102014003704A1 (en) | Platform agnostic power management | |
CN102253860A (en) | Asynchronous operation method and asynchronous operation management device | |
WO2020232875A1 (en) | Actor model-based task scheduling method and apparatus, and storage medium | |
CN104123194A (en) | Communication structure and method for kernel mode and user mode | |
CN101221541A (en) | Programmable communication controller for SOC and its programming model | |
CN105183549A (en) | Automatic ticketing system based on task assignment | |
CN101369224A (en) | Providing quality of service via thread priority in a hyper-threaded microprocessor | |
CN101546275B (en) | Method for realizing multiprocessor system with hardware semaphore module | |
WO2023045203A1 (en) | Task scheduling method, chip, and electronic device | |
CN101470636A (en) | Message read-write method and apparatus | |
CN102200929A (en) | Method for processing asynchronous communication among tasks and system for processing multi-task asynchronous communication | |
CN106063304A (en) | Systems and methods for messaging-based fine granularity system-on-a-chip power gating | |
US7552439B2 (en) | System and method to allow non-deterministic execution in a process control system | |
US10713188B2 (en) | Inter-process signaling system and method | |
CN100426241C (en) | Message level soft interrupt processing method in service system structure | |
CN109062857A (en) | A kind of new type of messages controller and its communication means that can be communicated between realization of High Speed multiprocessor | |
US6708259B1 (en) | Programmable wake up of memory transfer controllers in a memory transfer engine |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20110928 |