CN100458757C - Inter core communication method and apparatus for multi-core processor in embedded real-time operating system - Google Patents

Inter core communication method and apparatus for multi-core processor in embedded real-time operating system Download PDF

Info

Publication number
CN100458757C
CN100458757C CNB2005100873210A CN200510087321A CN100458757C CN 100458757 C CN100458757 C CN 100458757C CN B2005100873210 A CNB2005100873210 A CN B2005100873210A CN 200510087321 A CN200510087321 A CN 200510087321A CN 100458757 C CN100458757 C CN 100458757C
Authority
CN
China
Prior art keywords
message
nuclear
multinuclear
shared
pool
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.)
Active
Application number
CNB2005100873210A
Other languages
Chinese (zh)
Other versions
CN1904873A (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.)
Datang Mobile Communications Equipment Co Ltd
Original Assignee
Datang Mobile Communications Equipment 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 Datang Mobile Communications Equipment Co Ltd filed Critical Datang Mobile Communications Equipment Co Ltd
Priority to CNB2005100873210A priority Critical patent/CN100458757C/en
Publication of CN1904873A publication Critical patent/CN1904873A/en
Application granted granted Critical
Publication of CN100458757C publication Critical patent/CN100458757C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses an inter-core communicating method of multi-core processor in embedded real time operation system. It includes following steps: distributing memory as multi-core information sharing pool; writing information the source core would send into the pool; sending the information to target core; target core sending the information storing in pool to target mission. The invention also discloses an inter-core communicating device. It improves the inter-core communicating efficiency and realizes the unification of inner core communication and inter-core communication.

Description

The communication method between cores of polycaryon processor and device in the embedded real-time operating system
Technical field
The present invention relates to embedded real-time operating system and polycaryon processor, relate in particular to the communication method between cores and the device of polycaryon processor in a kind of embedded real-time operating system.
Background technology
Along with network and fast development of computer technology, more and more higher to the performance requirement of CPU (Central Process Unit, central processing unit).The lifting of cpu performance mainly realized by improving dominant frequency in the past, and the lifting of dominant frequency requires to increase considerably transistorized quantity, and thing followed heat dissipation problem also highlights day by day.Except improving dominant frequency, another method that improves cpu performance is exactly a polycaryon processor.
Polycaryon processor is an integrated plural computing unit on a processor, and each computing unit becomes a nuclear, makes a CPU that the performance of approaching many CPU is provided.Moving separately task on each nuclear in the polycaryon processor, and usually needing transfer data information (being referred to as pass-along message usually) between the task on a plurality of nuclear, in the prior art, internuclearly communicating by data pipe a plurality of.
Figure 1 shows that two nuclears, the structure of the polycaryon processor of nuclear M 110 and nuclear N 120, nuclear M 110 and nuclear N 120 have respectively separately special- purpose memory field 130 and 140, two internuclearly have a shared memory 170.Each nuclear is assigned to other in shared drive district 170 authorizes the data pipe that send data to use, because data pipe is unidirectional, so nuclear M that nuclear M 110 distributes is arranged in shared drive district 170 to examining nuclear N that N data pipe 180 and nuclear N distribute to examining M data pipe 190.Each nuclear is being stored the routing table of a static state in special-purpose memory field, point to the data pipe of other nuclears.Nuclear M 110 and nuclear N120 have empty interrupt module 150 and 160 separately respectively, and any one is endorsed to trigger the once empty of this nuclear by the empty interrupt module of operating purpose nuclear and interrupts, and this interrupt notification purpose nuclear has new data arrival in data channel.
When the purpose task of an originating task on the nuclear M 110 on nuclear N 120 sends message, routing table in the special-purpose memory field 130 of nuclear M 110 inquiries, find nuclear M to examining N data pipe 180, data message that will pass-along message copies nuclear M to examining the N data pipe 180 from special-purpose memory field 130; Simultaneously, nuclear M 110 uses inner empty the interruption to shake hands with nuclear N 120 by the empty interrupt module 160 of nuclear N 120, transmits purpose task identification and message identifier.The empty interruption of nuclear N 120 response copies in the special-purpose memory field 140 from nuclear M to the data message of examining the N data pipe 180 this message according to the purpose task identification, is packaged as message and passes to the purpose task.
In the prior art, there is following problem in the internuclear communication of polycaryon processor:
Once be restricted in internuclear message transmitted length: because data pipe is a fixed allocation in the shared drive district, taking the shared drive district all the time, data pipe can not distribute very big internal memory usually; In order to reduce the possibility that read-write clashes in the data pipe, data pipe need be designed to have certain depth simultaneously, promptly can hold multiple messages, the length of every message is restricted like this, and communication can only be transmitted the message of small data quantity between general kernel;
Internuclear communication efficiency is low: from above-mentioned message transmitting process as can be known, finish once all data that internuclear communication needs twice this message of copy, this has greatly reduced the efficient of internuclear communication;
Task communication is different with internuclear task communication mode in the nuclear: ERTOS (Embedded Real TimeOperating System, embedded real-time operating system) provides message queue mechanism for the intertask communication in the nuclear; And the data pipe that internuclear communication is adopted is virtual I/O (input and output) equipment for ERTOS, adopts the communication mechanism that provides is provided, and this makes that the exploitation of application program is very inconvenient.
Summary of the invention
The present invention will solve is that the internuclear communication efficiency of existing polycaryon processor is low, once the message transmitted length of communicating by letter is communicated by letter and the internuclear skimble-scamble problem of communicating by letter in being restricted and examining.
The communication method between cores of polycaryon processor may further comprise the steps in the embedded real-time operating system of the present invention:
A) storage allocation is shared message pool as multinuclear in the shared drive district;
B) source nuclear is shared at multinuclear and is distributed multinuclear message memory block in the message pool, is used for writing described message
C) source is examined the message that will send and is write the shared message pool of multinuclear;
D) source nuclear sends to purpose nuclear with address, the purpose task identification of described message in the shared message pool of multinuclear by data pipe;
E) purpose is examined the described message that address described in the shared message pool of multinuclear is deposited and is sent the purpose task to;
F) after the purpose task receives message, purpose nuclear shared multinuclear message memory block of release message from share message pool.
In addition, the shared drive district of described polycaryon processor is provided with the data pipe that is used for internuclear communication.
Preferably, described multinuclear message memory block comprises header information zone and data area, wherein said header information zone is used for depositing header information, described header information comprises the size of described multinuclear message memory block, affiliated task identification, and described data area is used for depositing the data of described message;
The message memory block of the monokaryon message pool of described embedded real-time operating system has identical form with the header information of described multinuclear message memory block.
Preferably, step e) specifically also comprises: purpose nuclear is put into the address of described message in the shared message pool of multinuclear the message queue of purpose task.
Preferably, specifically also comprise between described step a) and the step b):
Source nuclear indicates the purpose nuclear sign and the purpose task identification of described message;
Judge whether described purpose nuclear sign identical with source nuclear sign, if identical, then message transmission function sends to the purpose task with message in the monokaryon that provides by described embedded real-time operating system, and does not carry out described step b), c), d), e); If different, execution in step b then), e d c))).
Preferably, comprise before the described step a): the sign of all tasks of moving on the polycaryon processor being carried out the nuclear of unified numbering and this task of record operation;
Also specifically comprise between described step a) and the step b):
Source nuclear indicates the purpose mission number of described message;
Judge the whether operation on the nuclear of source of described purpose task, if then message sends function message is sent to the purpose task in the monokaryon that provides by described embedded real-time operating system, and does not carry out described step b), c), d), e); If not, e d c execution in step b then)))).
Preferably, nuclear is examined not simultaneously with purpose when the source of described message, comprises before the described step b): source nuclear locking multinuclear is shared the spin lock of message pool;
Comprise between described step b) and the step c): source nuclear is removed the spin lock that multinuclear is shared message pool.
Preferably, nuclear is examined not simultaneously with purpose when the source of described message, comprises after the described step e) with before the step f): the spin lock of the shared message pool of purpose nuclear locking multinuclear;
Comprise after the described step f): purpose nuclear is removed the spin lock that multinuclear is shared message pool.
Preferably, described step d) is specially:
Address and purpose task identification that source nuclear is shared described message in the message pool at multinuclear are copied to described data pipe;
Source nuclear triggers the void interruption of purpose nuclear;
The empty interruption of purpose nuclear response copies out address and the purpose task identification of described message in the shared message pool of multinuclear from described data pipe.
The present invention also provides the internuclear communicator of polycaryon processor in a kind of embedded real-time operating system, comprise nuclear, internuclear communication control module, empty interrupt module, inter-core message module and comprise data channel and the shared drive district of the shared message pool of multinuclear, wherein:
Described inter-core message module instructs the message that will send to write the shared message pool of multinuclear according to the transmission of described nuclear, returns to described nuclear and sends the address of message in the shared message pool of multinuclear; And, read reception message and pass to described nuclear according to the address of the message that will receive in the shared message pool of multinuclear of described nuclear transmission;
Described multinuclear is shared the message that message pool is used for storing internuclear communication;
Described internuclear communication control module is used for copying in the data channel according to address and purpose task identification that the message that the transmission of described nuclear instruction will send is shared in the message pool at multinuclear, and other are authorized address and the purpose task identification shared in the message pool at multinuclear toward the message of described nuclear copies from data channel to described nuclear;
Described data channel is used at address and the purpose task identification of internuclear pass-along message in the shared message pool of multinuclear;
Described empty interrupt module interrupts according to the void of other nuclears of transmission instruction triggers of described nuclear, and the described stone grafting of the empty interrupt notification of triggering for generating of accepting other nuclears is received other and authorized the message of sending;
Described device also comprises communication module and monokaryon message pool in identification module, the nuclear, wherein:
It is the transmission instruction of described nuclear that described identification module is used for the purpose nuclear of identification message, and is that the transmission instruction of described nuclear passes to communication module in the described nuclear with purpose nuclear;
Communication module is distributed and the release message memory block in described monokaryon message pool according to the transmission instruction of described nuclear in the described nuclear, the communication in examining by the message memory block between task;
Described monokaryon message pool is stored the message of intertask communication in the nuclear with the message memory block.
Preferably, described inter-core message module comprises message memory modules and spin lock module, wherein:
Described message memory modules is shared at multinuclear for the message that will send according to the transmission instruction of described nuclear and is distributed multinuclear message memory block in the message pool, in the multinuclear message memory block that distributes, write transmission message, return to described nuclear and send the address of message in the shared message pool of multinuclear; Perhaps, read reception message and pass to described nuclear, and discharge the multinuclear message memory block that receives message according to the address of the message that will receive in the shared message pool of multinuclear of described nuclear transmission;
Described spin lock module described multinuclear of locking before described message memory modules distributes and discharges multinuclear message memory block is shared the spin lock of message pool, and removes described spin lock in distribution with after discharging multinuclear message memory block.
Preferably, described multinuclear message memory block and message memory block all comprise header information zone and data area, wherein said header information comprises the size of described multinuclear message memory block or described message memory block, affiliated task identification, and described data area is used for depositing the data of described message;
Described multinuclear message memory block has identical header information form with described message memory block.
The present invention shares the message that message pool is stored in internuclear transmission by set up multinuclear in the shared drive district, lead to address in the message pool with the data pipe message transfer at multinuclear, realized internuclear message queue communication mechanism, thereby avoided the copy procedure of twice message data, improved the efficient of internuclear communication, the length of each message transfer also no longer is subjected to the restriction of data pipe capacity;
And then, because monokaryon task communication and internuclear task communication all adopt message queue mechanism among the present invention, and send and receiving interface for nuclear provides single message, realized communication and internuclear unification of communicating by letter in the nuclear, for the exploitation of application program provides convenience.
Description of drawings
Figure 1 shows that the structural representation of polycaryon processor with two nuclears;
Figure 2 shows that the process flow diagram of communication method between cores of the present invention;
Figure 3 shows that the structural drawing of internuclear communicator of the present invention.
Embodiment
ERTOS provides message queue mechanism for task communication in the nuclear of monokaryon.ERTOS is controlling an internal memory in the special-purpose memory field of nuclear, be exclusively used in the message data storage of communication in the nuclear, and this piece internal memory is called the monokaryon message pool.Task is distributed the message memory block of specifying size from the monokaryon message pool by ERTOS before sending message.A message memory block is divided into header information zone and data area, has write down the relevant information of this message memory block in the header information zone, and as the ID (sign) or the like of size, affiliated task, task is deposited message data in the data area.
Message queue is by the task creation that operates on the nuclear, message queue comes down to a chained list, each represents a message in the chained list, its actual content is distinguished to some extent because of the difference of ERTOS, indispensable content is to point to the indicator linking of the message of representative, or perhaps the address of this message in the monokaryon message pool.
When task sends message, message data is written in the data area of institute's assignment messages memory block.Afterwards, calling message that ERTOS provides sends in the message queue that function sends a message to the binding of purpose task.Being implemented as follows of this process: ERTOS revises the indicator linking of purpose task message formation, makes it point to this message memory block; Revising the link information that writes down in the message memory block header information is inserted into the message memory block in the message queue chained list of purpose task.
As seen, not copying data generation in this course.It needs to be noted that the realization mechanism of ERTOS message queue must be consistent with the realization mechanism of message pool, because both need unified understanding for the header information form of message memory block.
The monokaryon message pool of ERTOS is the message pool that a kind of monokaryon is monopolized, only be a nuclear give information memory block distribution and reclaim function.Exclusive reference for the monokaryon message pool only need carry out between a plurality of tasks on the nuclear, and mechanism such as the semaphore that is provided by ERTOS, mutual exclusion lock realize.The monokaryon message pool can not be served the message communicating between multinuclear.
Thinking of the present invention is the message pool that realizes that multinuclear is shared, and the message queue of task is realized inter-core message communication in the syncaryon.Among the present invention the flow process of internuclear communication means as shown in Figure 2, wherein, the nuclear that sends the task run of message is source nuclear, the nuclear that receives the purpose task run of message is purpose nuclear.
At step S010, storage allocation is shared message pool as multinuclear in the shared drive district.Multinuclear is shared message pool and is used for depositing the message data and the header information of internuclear communication, can create in the system initialization process, also can authorize in the source and create before sending message.
At step S020, the source of setting up in the shared drive district is examined to the data pipe of purpose nuclear.Identical in the method for setting up data pipe and the prior art, repeat no more.
In the present invention, source nuclear still needs to examine address and the purpose task ID of pass-along message in the shared message pool of multinuclear by data pipe to purpose, that is to say that address and purpose task ID still need through twice copy.But because these contents only have only the data of several bytes, thereby can impact internuclear communication efficiency hardly.
At step S030, judge whether source nuclear carries out internuclear communication, if, execution in step S050; If not, execution in step S040, message sends function and sends message in the monokaryon that provides by ERTOS, the communication in examining between task.
Because internuclear communication of the present invention can adopt the mode of message queue to realize, so just possesses the condition of interior communication of unified nuclear and internuclear communication interface.That is to say that needn't distinguishing communicates by letter in the nuclear all uses identical parameter with internuclear communication, is communication or internuclear communication in the nuclear according to these parameters judgements when sending message.
This step has multiple realization means, below is two optional modes:
Source nuclear no matter communicate by letter or internuclear communication in the nuclear, all comprises the purpose nuclear ID and the purpose task ID of this message in parameter when sending message; Like this, as long as judge that whether purpose nuclear ID is identical with source nuclear ID, can learn communication or internuclear communication in the nuclear;
All tasks of moving on the polycaryon processor are carried out unified numbering, the ID of the nuclear of this task of record operation simultaneously; Source nuclear all comprises the purpose mission number of this message in parameter when sending message; Find out the nuclear ID of operation purpose task, whether identical can learning in the nuclear communicated by letter or internuclear communication with source nuclear ID to see it.
At step S050, source nuclear locking multinuclear is shared the spin lock of message pool.
In multiple nucleus system with shared drive district, because each nuclear can ask to use the critical resource in the shared drive district time in office, the memory block that can share for multinuclear, so the shared drive district should provide a kind of mutual exclusion mechanism, is thrown into confusion to avoid resource to use.The shared drive district realizes exclusive reference as follows:
Before each nuclear certain critical resource in using the shared drive district, need application storage allocation space in this critical resource, apply for successfully after this nuclear obtain the address of the memory headroom applied for.Nuclear can only visit this section memory headroom by this address, other nuclears want this section memory headroom is operated, must obtain this address earlier, thereby endorsing to use this section memory headroom alone of filing an application, also can give other nuclear with the control of this section memory headroom.
The shared drive district provides spin lock with distribution and the dispose procedure of control to this critical resource for each critical resource.Any one nuclear can attempt to lock a spin lock, if this spin lock is examined locking and is not had release by other, then the operation of this application locking can make the nuclear of carrying out this operation be absorbed in busy grade for state, up to its execution unlocking operation of checking that takies this spin lock.Certain is checked critical resource and proposes memory headroom and distribute application, and the locking spin lock exists to guarantee the operation to the critical resource memory headroom that the same time do not have other, guarantees that assigned memory headroom is had the right to use of monopolizing.
Also adopt spin lock to realize the internuclear exclusive reference of multinuclear being shared message pool among the present invention.
At step S060, source nuclear is shared at multinuclear and is distributed multinuclear message memory block in the message pool, is used for writing described message.Multinuclear message memory block also comprises header information zone and data area among the present invention, and wherein header information also comprises information such as the size of multinuclear message memory block, affiliated task ID, and the data area is used for depositing the data of message transfer.
In order to realize examining interior communication and internuclear unification of communicating by letter, multinuclear message memory block should have identical structure with the message memory block in the monokaryon message pool, the form of especially identical header information.
At step S070, source nuclear is removed the spin lock that multinuclear is shared message pool.
At step S080, the message that source nuclear will send writes multinuclear and shares message pool, promptly is written in multinuclear and shares the multinuclear message memory block that is assigned in the message pool.
At step S090, address, purpose task ID that source nuclear is shared this message in the message pool at multinuclear send to purpose nuclear by data pipe.
Identical in the method that sends data by data pipe in this step and the prior art, be specially:
Source nuclear is shared this message with address in the message pool and purpose task identification at multinuclear and is copied to the source and examines to the data pipe of purpose nuclear;
Source nuclear triggers the void interruption of purpose nuclear;
Purpose is examined the empty interruption of response, examines to the data pipe of purpose nuclear from the source and copies out address and the purpose task identification of this message in the shared message pool of multinuclear.
At step S100, purpose nuclear is shared multinuclear with the message that deposit this address in the message pool and is sent the purpose task to.
When multinuclear message memory block has identical structure with the message memory block of monokaryon, the purpose task can adopt with examine in the same method of communicating by letter receive message.In this case, purpose nuclear writes the link information that this message is included in the address in the shared message pool of multinuclear in the message queue of purpose task, and the purpose task can be authorized the message of sending in the source of receiving.
At step S110, purpose nuclear locking multinuclear is shared the spin lock of message pool.
At step S120, purpose nuclear discharges described multinuclear message memory block.
At step S130, purpose nuclear is removed the spin lock that multinuclear is shared message pool.
After the purpose task receives message, the multinuclear message memory block that the message of execution in step S110 to S130 release communication takies.
The present invention also provides and has realized internuclear communicating devices among a kind of ERTOS, and its structure as shown in Figure 3.Need to prove that it is that all nuclears are shared in the polycaryon processor that shared drive district 350, the data channel in shared drive district 350 351 and multinuclear are shared message pool 352, other modules among the figure are then only used by a nuclear.Data channel 351 is used at address and the purpose task identification of internuclear pass-along message in the shared message pool of multinuclear, and multinuclear is shared the message that message pool 352 is used for storing internuclear communication.
Authorize when sending message to another at nuclear 310, send instruction to output.Message memory modules 341 in the inter-core message module 340 is shared in message pool 352 distribution multinuclear message memory block for the message that will send at multinuclear according to sending instruction, write transmission message therein, and will send message and return to nuclear 310 in the address that multinuclear is shared in the message pool 352;
Nuclear 310 sends instruction to internuclear communication control module 320 outputs, and address and purpose task identification that the message that will send is shared in the message pool 352 at multinuclear are notified internuclear communication control module 320 simultaneously.Internuclear communication control module 320 copies this address and purpose task identification in the data channel 351 to;
Nuclear 310 sends instruction to empty interrupt module 330 outputs, and the void that empty interrupt module 330 triggers purpose nuclear is interrupted; So far, message is sent completely.
When nuclear 310 sent message, the triggering for generating void that empty interrupt module 330 is accepted to examine in the source was interrupted as another nuclear, and notice nuclear 310 has other to authorize the message arrival of sending;
Nuclear 310 notifies internuclear communication control module 320 to receive data, and internuclear communication control module 320 is authorized address and the purpose task identification shared in the message pool 352 at multinuclear toward the message of nuclear 310 with the source and copied to nuclear 310;
Nuclear 310 instruction inter-core message modules 340 reading of data, the address notification inter-core message module 340 of the message that will receive simultaneously in the shared message pool 352 of multinuclear, the assigned address that message memory modules 341 in the inter-core message module 340 is shared message pool 352 from multinuclear reads and receives message and pass to nuclear 310, and discharges the multinuclear message memory block that receives message in the message back of finishing using; So far, message sink is finished.
Spin lock module 342 in the inter-core message module 340 is used for controlling the exclusive reference of multinuclear being shared critical resource in the message pool 352, the locking multinuclear is shared the spin lock of message pool 352 before message memory modules 341 distributes and discharges multinuclear message memory block, and removes spin lock in distribution with after discharging multinuclear message memory block.
To have unified interface in order communicating by letter in making internuclear communication and examining to examining 310, can between nuclear 310 and connected inter-core message module 340, internuclear communication control module 320 and empty interrupt module 330, to increase identification module 360.
Because nuclear 310 is triggered by empty interrupt module 320 when the message that receives from internuclear communication, therefore can identification module 360 when nuclear 310 sends data, the purpose nuclear of message is discerned for the transmissions instruction of nuclear 310 itself, and purpose nuclear is passed to communication module 370 in the nuclear for the transmissions instruction of nuclear 310 itself.
Communication module 370 is distributed and the release message memory block in monokaryon message pool 380 according to sending instruction in the nuclear, the communication in examining by the message memory block between task.Monokaryon message pool 380 is stored the message of intertask communication in the nuclear with the message memory block.
When multinuclear is shared 380 pairs of message pool 352 and monokaryon message pool multinuclear message memory block separately when identical with the realization mechanism of message memory block, nuclear 310 can adopt same message queue to receive internuclear communication and examine in the message of communicating by letter.This needs multinuclear message memory block the same with the message memory block, comprises header information zone and data area, and wherein header information comprises the size of memory block, affiliated task identification, and the data area is used for depositing the data of message; Simultaneously, multinuclear message memory block also will have identical header information form with the message memory block.
As seen, internuclear communication among the present invention is not as long as the data of the several bytes of copy copy and do not need that the data of message are carried out secondary, and such communication mechanism has improved the efficient of internuclear communication, can satisfy the needs of more application; The present invention also carries out the interface that the interface of inter-core message formation communication is communicated by letter with multitask in the monokaryon unified, convenient for users to use.And multinuclear provided by the invention is shared the function of message pool, can satisfy user's demand more.
Relevant with the employed motherboard hardware of ERTOS in specific implementation by data channel in the process of internuclear transmission data.For ERTOS can be operated on the multiple mainboard without modification, scheme of the prior art is to increase one deck BSP (Board Support Package in motherboard hardware and ERTOS, plate level support package), for ERTOS provides correct interface, the difference of shielding bottom hardware.Specific to the realization of internuclear data channel, with BSP two interfaces are arranged, one is the interface that is offered data receiver by BSP, the interface that another Data Receiving direction BSP provides.
The present invention's suggestion is carried out standardized definition to above-mentioned two interfaces, like this, when hardware environment changes or BSP realizes that the internal mechanism of internuclear fixed-length data communication changes or when realizing the function of internuclear fixed-length data communication by other module, as long as deferred to the standardization definition of these two interfaces, the method for the invention or device without change still can be correct work.This can improve portability to the full extent.
The present invention only need know purpose nuclear and purpose task ID when realizing internuclear communication, thereby is not only applicable to the ERTOS of static task, also is applicable to the ERTOS with dynamic creation task function.
The above embodiments of the present invention does not constitute the qualification to protection domain of the present invention.Any any modification of being done within the spirit and principles in the present invention, be equal to and replace and improvement etc., all should be included within the claim protection domain of the present invention.

Claims (11)

1. the communication method between cores of polycaryon processor in the embedded real-time operating system, the shared drive district of described polycaryon processor is provided with the data pipe that is used for internuclear communication, it is characterized in that, may further comprise the steps:
A) storage allocation is shared message pool as multinuclear in the shared drive district;
B) source nuclear is shared at multinuclear and is distributed multinuclear message memory block in the message pool, is used for writing the message that will send;
C) source is examined the message that will send and is write the shared message pool of multinuclear;
D) source nuclear sends to purpose nuclear with address, the purpose task identification of described message in the shared message pool of multinuclear by data pipe;
E) purpose is examined the described message that address described in the shared message pool of multinuclear is deposited and is sent the purpose task to;
F) after the purpose task receives message, purpose nuclear shared multinuclear message memory block of release message from share message pool.
2. according to the described communication method between cores of claim 1, it is characterized in that: described multinuclear message memory block comprises header information zone and data area, wherein said header information zone is used for depositing header information, described header information comprises the size of described multinuclear message memory block, affiliated task identification, and described data area is used for depositing the data of described message;
The message memory block of the monokaryon message pool of described embedded real-time operating system has identical form with the header information of described multinuclear message memory block.
3. according to the described communication method between cores of claim 2, it is characterized in that step e) specifically also comprises: purpose nuclear is put into the address of described message in the shared message pool of multinuclear the message queue of purpose task.
4. according to the described communication method between cores of claim 3, it is characterized in that, specifically also comprise between described step a) and the step b): source nuclear indicates the purpose nuclear sign and the purpose task identification of described message;
Judge whether described purpose nuclear sign identical with source nuclear sign, if identical, then message transmission function sends to the purpose task with message in the monokaryon that provides by described embedded real-time operating system, and does not carry out described step b), c), d), e); If different, then carry out described step b), c), d), e).
5. according to the described communication method between cores of claim 3, it is characterized in that, comprise before the described step a): the sign of all tasks of moving on the polycaryon processor being carried out the nuclear of unified numbering and this task of record operation;
Also specifically comprise between described step a) and the step b):
Source nuclear indicates the purpose mission number of described message;
Judge the whether operation on the nuclear of source of described purpose task, if then message sends function message is sent to the purpose task in the monokaryon that provides by described embedded real-time operating system, and does not carry out described step b), c), d), e); If not, then carry out described step b), c), d), e).
6. according to any described communication method between cores of claim 2 to 5, it is characterized in that: nuclear is examined not simultaneously with purpose when the source of described message, comprises before the described step b): source nuclear locking multinuclear is shared the spin lock of message pool;
Comprise between described step b) and the step c): source nuclear is removed the spin lock that multinuclear is shared message pool.
7. according to the described communication method between cores of claim 6, it is characterized in that nuclear is examined not simultaneously with purpose when the source of described message, comprises after the described step e) with before the step f): the spin lock of the shared message pool of purpose nuclear locking multinuclear;
Comprise after the described step f): purpose nuclear is removed the spin lock that multinuclear is shared message pool.
8. according to the described communication method between cores of claim 7, it is characterized in that described step d) is specially:
Address and purpose task identification that source nuclear is shared described message in the message pool at multinuclear are copied to described data pipe;
Source nuclear triggers the void interruption of purpose nuclear;
The empty interruption of purpose nuclear response copies out address and the purpose task identification of described message in the shared message pool of multinuclear from described data pipe.
9. the internuclear communicator of polycaryon processor in the embedded real-time operating system, it is characterized in that, comprise nuclear, internuclear communication control module, empty interrupt module, inter-core message module and comprise data channel and the shared drive district of the shared message pool of multinuclear, wherein:
Described inter-core message module instructs the message that will send to write the shared message pool of multinuclear according to the transmission of described nuclear, returns to described nuclear and sends the address of message in the shared message pool of multinuclear; And, read reception message and pass to described nuclear according to the address of the message that will receive in the shared message pool of multinuclear of described nuclear transmission;
Described multinuclear is shared the message that message pool is used for storing internuclear communication;
Described internuclear communication control module is used for copying in the data channel according to address and purpose task identification that the message that the transmission of described nuclear instruction will send is shared in the message pool at multinuclear, and other are authorized address and the purpose task identification shared in the message pool at multinuclear toward the message of described nuclear copies from data channel to described nuclear;
Described data channel is used at address and the purpose task identification of internuclear pass-along message in the shared message pool of multinuclear;
Described empty interrupt module interrupts according to the void of other nuclears of transmission instruction triggers of described nuclear, and the described stone grafting of the empty interrupt notification of triggering for generating of accepting other nuclears is received other and authorized the message of sending;
Described device also comprises communication module and monokaryon message pool in identification module, the nuclear, wherein:
It is the transmission instruction of described nuclear that described identification module is used for the purpose nuclear of identification message, and is that the transmission instruction of described nuclear passes to communication module in the described nuclear with purpose nuclear;
Communication module is distributed and the release message memory block in described monokaryon message pool according to the transmission instruction of described nuclear in the described nuclear, the communication in examining by the message memory block between task;
Described monokaryon message pool is stored the message of intertask communication in the nuclear with the message memory block.
10. according to the described internuclear communicator of claim 9, it is characterized in that described inter-core message module comprises message memory modules and spin lock module, wherein:
Described message memory modules is shared at multinuclear for the message that will send according to the transmission instruction of described nuclear and is distributed multinuclear message memory block in the message pool, in the multinuclear message memory block that distributes, write transmission message, return to described nuclear and send the address of message in the shared message pool of multinuclear; Perhaps, read reception message and pass to described nuclear, and discharge the multinuclear message memory block that receives message according to the address of the message that will receive in the shared message pool of multinuclear of described nuclear transmission;
Described spin lock module described multinuclear of locking before described message memory modules distributes and discharges multinuclear message memory block is shared the spin lock of message pool, and removes described spin lock in distribution with after discharging multinuclear message memory block.
11. according to the described internuclear communicator of claim 10, it is characterized in that, described multinuclear message memory block and message memory block all comprise header information zone and data area, wherein said header information comprises the size of described multinuclear message memory block or described message memory block, affiliated task identification, and described data area is used for depositing the data of described message;
Described multinuclear message memory block has identical header information form with described message memory block.
CNB2005100873210A 2005-07-28 2005-07-28 Inter core communication method and apparatus for multi-core processor in embedded real-time operating system Active CN100458757C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100873210A CN100458757C (en) 2005-07-28 2005-07-28 Inter core communication method and apparatus for multi-core processor in embedded real-time operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100873210A CN100458757C (en) 2005-07-28 2005-07-28 Inter core communication method and apparatus for multi-core processor in embedded real-time operating system

Publications (2)

Publication Number Publication Date
CN1904873A CN1904873A (en) 2007-01-31
CN100458757C true CN100458757C (en) 2009-02-04

Family

ID=37674139

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100873210A Active CN100458757C (en) 2005-07-28 2005-07-28 Inter core communication method and apparatus for multi-core processor in embedded real-time operating system

Country Status (1)

Country Link
CN (1) CN100458757C (en)

Families Citing this family (42)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100451975C (en) * 2007-02-13 2009-01-14 杭州华三通信技术有限公司 System and method for implementing packet combined treatment by multi-core CPU
CN101170511B (en) * 2007-11-20 2010-11-24 中兴通讯股份有限公司 Device and method for realizing multi-core processor communication in built-in operating system
CN101158920B (en) * 2007-11-22 2011-02-16 杭州华三通信技术有限公司 Method and apparatus for detecting fault of operating system
CN101458650B (en) * 2007-12-13 2010-12-15 华为技术有限公司 Apparatus and method for detecting internal memory transfer abnormity in multi-core system
CN100580630C (en) * 2007-12-29 2010-01-13 中国科学院计算技术研究所 Multi-core processor meeting SystemC grammar request and method for acquiring performing code
US7908403B2 (en) * 2008-02-14 2011-03-15 International Business Machines Corporation Reserved device access contention reduction
CN101262501B (en) * 2008-04-23 2011-04-20 杭州华三通信技术有限公司 An inter-core communication method in multi-core system and one multi-core system
CN101635006B (en) * 2008-07-22 2012-02-29 中国科学院计算技术研究所 Mutual exclusion and semaphore cell block of multi-core processor satisfying SystemC syntax
CN101634956B (en) * 2009-08-25 2012-08-08 华为技术有限公司 Dispatching method and dispatcher of information of polynuclear processor
CN101894092B (en) * 2010-07-28 2012-09-26 杭州华三通信技术有限公司 Multi-core CPU and inter-core communication method thereof
CN102073565B (en) * 2010-12-31 2014-02-19 华为技术有限公司 Action triggering method, multi-core packet debugging method, device and system thereof
CN102355423B (en) * 2011-10-19 2013-11-27 迈普通信技术股份有限公司 Forwarded resource access method and routing system
EP2801907A4 (en) 2012-02-01 2014-12-03 Huawei Tech Co Ltd Multicore processor system
CN106371933B (en) * 2012-05-29 2019-08-20 安科讯(福建)科技有限公司 The method of the intercommunication of more software runtime environments
CN104426958B (en) * 2013-08-29 2018-03-16 华为技术有限公司 A kind of communication means, apparatus and system
CN104572315B (en) * 2013-10-23 2018-12-25 华为技术有限公司 Realize method, communication entity and the distributed communication system of intersubsystem communication
CN103559079A (en) * 2013-11-15 2014-02-05 深圳市道通科技有限公司 Shared memory based data access method and device
CN103825782B (en) * 2014-03-07 2017-08-22 新华三技术有限公司 It is a kind of to utilize the internuclear method and apparatus for interrupting the unreasonable task of positioning
CN105589829A (en) * 2014-09-15 2016-05-18 华为技术有限公司 Data processing method based on multi-core processor chip, device and system
CN104462008A (en) * 2014-12-05 2015-03-25 三星半导体(中国)研究开发有限公司 Physical-memory-shared multi-processor communication system and communication method thereof
CN105824779A (en) * 2016-03-16 2016-08-03 享拍科技(深圳)有限公司 Data communication method and system used between double cores
DE102016003362A1 (en) * 2016-03-18 2017-09-21 Giesecke+Devrient Currency Technology Gmbh Device and method for evaluating sensor data for a document of value
CN105893320B (en) * 2016-03-29 2019-08-06 浙江大学 A kind of remote task function calling method of multi-core processor oriented
CN108228524B (en) * 2016-12-14 2021-07-16 中国航空工业集团公司西安航空计算技术研究所 Inter-core interaction method of multi-core system
CN107127811A (en) * 2017-06-20 2017-09-05 佛山世科智能技术有限公司 Flexible material cutting robot intelligent digital controller and implementation method
CN107562685B (en) * 2017-09-12 2020-06-09 南京国电南自电网自动化有限公司 Method for data interaction between multi-core processor cores based on delay compensation
CN108958953A (en) * 2018-06-29 2018-12-07 南京南瑞继保电气有限公司 A kind of method for message interaction based on multi-core processor
CN110764924A (en) * 2018-07-27 2020-02-07 普天信息技术有限公司 Inter-core communication method and device of multi-core processor
CN109558368A (en) * 2018-11-27 2019-04-02 武汉虹旭信息技术有限责任公司 A kind of multi-core DSP processing chip intercore communication system and its method
CN109857573B (en) * 2018-12-29 2021-03-05 深圳云天励飞技术有限公司 Data sharing method, device, equipment and system
CN110347633B (en) * 2019-07-15 2021-08-06 北京茵沃汽车科技有限公司 Method, device and medium for superimposing vehicle signal state icons based on multiple cores
CN110825690B (en) * 2019-11-14 2022-03-15 北京华捷艾米科技有限公司 Inter-core communication method and device of multi-core processor
CN111190746A (en) * 2019-12-06 2020-05-22 中国航空工业集团公司洛阳电光设备研究所 VxWorks 653-based multi-core partition real-time operating system and communication method
CN111475202A (en) * 2020-03-31 2020-07-31 北京经纬恒润科技有限公司 Inter-core communication method and system based on heterogeneous multi-processing system
CN113535341B (en) * 2020-04-14 2023-09-22 大唐移动通信设备有限公司 Method and device for realizing interrupt communication between CPU cores under Linux
CN112241329B (en) * 2020-09-28 2021-08-24 深圳市商汤科技有限公司 Monitoring method, device and equipment of recognition engine and storage medium
CN112328533A (en) * 2020-11-09 2021-02-05 哲库科技(上海)有限公司 Multi-core processing system, inter-core communication method thereof, and storage medium
CN112416625B (en) * 2020-11-30 2024-04-09 深信服科技股份有限公司 Copy-free interprocess communication system and method
CN113326149B (en) * 2021-05-27 2022-11-15 展讯通信(天津)有限公司 Inter-core communication method and device of heterogeneous multi-core system
CN113377703B (en) * 2021-06-23 2024-04-09 上海擎昆信息科技有限公司 Inter-core communication method
CN113778706B (en) * 2021-08-18 2023-08-15 北京自动化控制设备研究所 Inter-core communication method of operation system based on AMP architecture
CN114253741B (en) * 2021-12-02 2022-11-08 国汽智控(北京)科技有限公司 Inter-core communication method of multi-core microprocessor and multi-core microprocessor

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030084269A1 (en) * 2001-06-12 2003-05-01 Drysdale Tracy Garrett Method and apparatus for communicating between processing entities in a multi-processor
US20040039880A1 (en) * 2002-08-23 2004-02-26 Vladimir Pentkovski Method and apparatus for shared cache coherency for a chip multiprocessor or multiprocessor system
US20050027793A1 (en) * 2002-10-08 2005-02-03 Hass David T. Advanced processor with mechanism for packet distribution at high line rate
CN1608249A (en) * 2001-10-22 2005-04-20 太阳微系统有限公司 Multi-core multi-thread processor
CN1609823A (en) * 2003-10-23 2005-04-27 英特尔公司 Method and equipment for maintenance of sharing consistency of cache memory

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030084269A1 (en) * 2001-06-12 2003-05-01 Drysdale Tracy Garrett Method and apparatus for communicating between processing entities in a multi-processor
CN1608249A (en) * 2001-10-22 2005-04-20 太阳微系统有限公司 Multi-core multi-thread processor
US20040039880A1 (en) * 2002-08-23 2004-02-26 Vladimir Pentkovski Method and apparatus for shared cache coherency for a chip multiprocessor or multiprocessor system
US20050027793A1 (en) * 2002-10-08 2005-02-03 Hass David T. Advanced processor with mechanism for packet distribution at high line rate
CN1609823A (en) * 2003-10-23 2005-04-27 英特尔公司 Method and equipment for maintenance of sharing consistency of cache memory

Also Published As

Publication number Publication date
CN1904873A (en) 2007-01-31

Similar Documents

Publication Publication Date Title
CN100458757C (en) Inter core communication method and apparatus for multi-core processor in embedded real-time operating system
KR100241218B1 (en) Systems and methods for controlling the transmission of relatively large data objects in a communications system
Baskett et al. Task communication in DEMOS
CN100429636C (en) Method, system and device for managing address spaces in shared I/O fabrics
CN100579108C (en) Method for remote key validation and host computer structure adapter
CN1647054B (en) Double-mode network device driving device, system and method
US5253342A (en) Intermachine communication services
US4720784A (en) Multicomputer network
JPS61289458A (en) Inter-process communication apparatus
US20070277179A1 (en) Information Processing Apparatus, Communication Processing Method, And Computer Program
JPS60160463A (en) Processor system
JP6516860B2 (en) Computer system and access control method
CN100593153C (en) Transmission of protected data in locking messages
JPH02158858A (en) Message transferring mechanism
CN103562882A (en) System and method for providing a messaging application program interface
US9015380B2 (en) Exchanging message data in a distributed computer system
CN101604302A (en) Advanced peripheral bus bridge and control method thereof
CN104679662A (en) Method and system for managing shared memory
EP2845110B1 (en) Reflective memory bridge for external computing nodes
US10229073B2 (en) System-on-chip and method for exchanging data between computation nodes of such a system-on-chip
CN100401279C (en) Configurable multi-port multi-protocol network interface to support packet processing
CN115114042A (en) Storage data access method and device, electronic equipment and storage medium
CN113826081A (en) Method for transmitting message in computing system and computing system
CN102043741A (en) Circuit and method for pipe arbitration
CN114969851A (en) Data processing method, device, equipment and medium based on FPGA

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