CN1924811A - Synchronous method and device used in multi-processor system - Google Patents

Synchronous method and device used in multi-processor system Download PDF

Info

Publication number
CN1924811A
CN1924811A CN 200510093629 CN200510093629A CN1924811A CN 1924811 A CN1924811 A CN 1924811A CN 200510093629 CN200510093629 CN 200510093629 CN 200510093629 A CN200510093629 A CN 200510093629A CN 1924811 A CN1924811 A CN 1924811A
Authority
CN
China
Prior art keywords
rotation lock
processor
multicomputer system
synchronous device
synchronous
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 200510093629
Other languages
Chinese (zh)
Other versions
CN100561439C (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.)
Industrial Technology Research Institute ITRI
Original Assignee
Industrial Technology Research Institute ITRI
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 Industrial Technology Research Institute ITRI filed Critical Industrial Technology Research Institute ITRI
Priority to CNB2005100936296A priority Critical patent/CN100561439C/en
Publication of CN1924811A publication Critical patent/CN1924811A/en
Application granted granted Critical
Publication of CN100561439C publication Critical patent/CN100561439C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

This invention relates to one synchronic method and device used in process system, which comprises the following steps: a, receiving processor rotation requirement and sending back rotation status to processor and if lock is at non locking status and changing the rotation status to locking status and otherwise, if lock is at locking status and stop process time impulse and enters the processor; then receiver processor releases lock requirement and changes the rotation status into non-locking status; finally, if other processor wait, then selecting one processor from certain strategy and restoring processor operation.

Description

Be used in the method for synchronous and the device of multicomputer system
Technical field
The present invention relates to a kind of synchronous (synchronization) method and apparatus that is used in multiprocessor (multi-processor) system, and particularly relate to the method for synchronous and the device of a kind of use rotation lock (spinlock).
Background technology
In multicomputer system, rotation lock is necessary synchronization mechanism.The program of on different processor, carrying out, if go to revise shared data structure simultaneously, can cause error in data, must be by the mechanism of rotation lock, have only success to obtain the program of the rotation lock of (acquire) this data structure, just have the right to revise shared data structure, so can ensure the correct of shared data structure.
The design of rotation lock can influence the usefulness of whole multicomputer system, the rotation lock of traditional method is to use an address in the middle of the storer, atomic operation (atomic operation is as test-and-set, load-linked, store-conditional etc.) and software program by processor are obtained rotation lock.If achieve success, just can go to revise shared data structure.If obtain failure, processor will enter circulation (loop), constantly checks the state of rotation lock.When a plurality of processors all when checking rotation lock, can consume the frequency range (bandwidth) of many buses (bus) and storer, therefore system effectiveness can descend.
Summary of the invention
The purpose of this invention is to provide a kind of method for synchronous that is used in multicomputer system, can save the bus and the memory band width of system.
Another object of the present invention provides a kind of synchronous device that is used in multicomputer system, does not need atomic operation just can reach the synchronous of multiprocessor, and can save power consumption, improves system effectiveness.
For reaching above-mentioned and other purpose, the present invention proposes a kind of method for synchronous that is used in multicomputer system, it is characterized in that: after processor is obtained the rotation lock failure, and successfully obtain before the rotation lock, suspend its time clock (clock signal), to suspend its action.
The above-mentioned method for synchronous that is used in multicomputer system also comprises the following steps: at first in one embodiment, and receiving processor is obtained the request (request) of rotation lock, and the state of passing rotation lock back is to processor.If rotation lock is in unlocked state, then the state with rotation lock changes lock-out state into.Otherwise,, then suspend the action of processor, and processor entered formation (queue) if rotation lock is in the lock state.Then, receiving processor discharges the request of (release) rotation lock, changes the state of rotation lock into unlocked state.At last,, then in formation, select a processor, the action of the processor that recovery is selected according to set strategy if there is other processor in formation, to wait for.
From another viewpoint, the present invention proposes a kind of synchronous device that is used in multicomputer system in addition, comprises rotation lock controller and clock controller (clock controller).The rotation lock controller receives and handles the request that a plurality of processors are obtained and discharged rotation lock.Clock controller then provides a plurality of time clock to above-mentioned processor, and, after processor is obtained the rotation lock failure, and successfully obtain before the rotation lock according to the indication of rotation lock controller, suspend the time clock of this processor, to suspend the action of this processor.
Described according to preferred embodiment of the present invention, the present invention is after processor is obtained the rotation lock failure, suspends its action.Wait at processor finishes then, successfully obtains before the rotation lock, recovers its action.When suspending, processor can not read the rotation lock state from storer as prior art is continuous, thus can save the bus and the memory band width of system, and then save power consumption, improve system effectiveness.The present invention uses rotation lock controller centralized control processor for the taking of rotation lock, thus do not need atomic operation just can reach multiprocessor synchronously.
Present portable multimedia electronic product reaches high-effect and low power consumption for asking, and adopts the multicomputer system of single-chip more.The present invention is specially adapted to the chip multiprocessors system, and the logic that only need increase a little in system-on-a-chip just can be realized.
For above and other objects of the present invention, feature and advantage can be become apparent, preferred embodiment of the present invention cited below particularly, and conjunction with figs. are described in detail below.
Description of drawings
Fig. 1 and Fig. 2 are the method for synchronous process flow diagram that is used in multicomputer system that is pursuant to one embodiment of the invention.
Fig. 3 is the synchronous device synoptic diagram that is used in multicomputer system that is pursuant to one embodiment of the invention.
Fig. 4 to Fig. 6 is the possible structural representation of the rotation lock controller of Fig. 3.The main element description of symbols
100~190,200~240: flow chart step
300: multicomputer system
310: synchronous device
311~314: processor
320: bus matrix
330: clock controller
340: the rotation lock controller
350: storer
410: Bus Interface Unit
420: the steering logic unit
430: arbitration unit
440: the buffer group
441: obtain buffer
442: discharge buffer
443: the formation buffer
444: the arbitration buffer
445: the priority cache device
520: the steering logic unit
540: the buffer group
541: Address Register
550: storer
620: the steering logic unit
640: Address Register
Embodiment
Fig. 1 is a wherein part that is pursuant to the method for synchronous process flow diagram that is used in multicomputer system of one embodiment of the invention.Fig. 1 itself is divided into two parts, is the flow process that processor is obtained rotation lock on the vertical dotted line left side, and the right is the core of this method, and just the flow process of the request of from processor is accepted and handled to synchronous device.
At first, in step 100, processor begins trial and obtains rotation lock.In step 110, processor can self-synchronous device provides obtains the state that buffer (acquisition register) reads rotation lock, and this reads action itself and also equals to send the request that obtains rotation lock to synchronous device.In step 160, after synchronous device is received the request of processor, the rotation lock state can be returned to processor.
Next, synchronous device can be checked the rotation lock state in step 170, and processor also can be checked the rotation lock state in step 120.If at this time rotation lock is in unlocked state, to represent unoccupiedly, synchronous device can change the state of rotation lock into lock-out state in step 190.On the other hand, processor can successfully be obtained rotation lock in step 150, just occupies rotation lock, just can go to revise shared data structure then.
Otherwise if rotation lock is in the lock state when synchronous device is received request, expression has other processor to occupy rotation lock, and the present action that obtains is failed.At this time, synchronous device can be obtained the action of the processor of rotation lock failure at step 180 time-out, and this processor is entered the formation wait.In the present embodiment, synchronous device is to suspend the time clock of processor, to suspend the action of processor.
On the other hand, find that in step 120 rotation lock is in the lock state, will enter the circulation continuation trial of getting back to step 110 and obtain rotation lock, but will soon be suspended action by synchronous device in step 130 when processor.Wait in formation finishes, and after step 140 was recovered action by synchronous device, processor can be got back to step 110, continued trial and obtained rotation lock.If at this time there is not other rival, processor just can successfully occupy rotation lock.
Please refer to Fig. 2 now, Fig. 2 is the another part that is pursuant to the method for synchronous process flow diagram of present embodiment.Fig. 2 is divided into two parts equally, is the flow process that processor discharges rotation lock on the vertical dotted line left side, and the right is the flow process that the request of from processor was accepted and handled in the synchronous device aspect.
At first, processor begins to discharge rotation lock in step 200, writes the release buffer (release register) that arbitrary numerical value provides to synchronous device in step 210.In the present embodiment, this write activity equals to propose to synchronous device the request of release rotation lock.Then, after synchronous device is received the request of processor, can change the state of rotation lock into unlocked state in step 220.In step 230, whether synchronous device can be checked has the wait in formation of other processor to obtain rotation lock then.If have, synchronous device can be selected a processor according to set strategy in step 240 from formation, and recovers the action of the processor select.In the present embodiment, above-mentioned set strategy can be that the processor that is introduced into formation recovers action (first in first out) earlier, or, from formation, select prepreerence processor, or known other selection or allocation strategy according to set priority ranking (priority).
Please refer to Fig. 3 now, Fig. 3 is the configuration diagram that is pursuant to the multicomputer system 300 of present embodiment.Multicomputer system 300 comprises the synchronous device 310 that processor 311~314, bus matrix (bus matrix) 320, storer 350 and the present invention propose.
The flow process on dotted line the right in the middle of Fig. 1 and Fig. 2 is exactly to be responsible for execution by synchronous device 310.Synchronous device 310 comprises rotation lock controller 340 and clock controller 330.Rotation lock controller 340 is obtained by bus matrix 320 receiving processors 311~314 and is discharged the request of rotation lock, and handles above-mentioned request.330 of clock controllers provide time clock to processor 311~314, and indication according to rotation lock controller 340, after wherein any one of processor 311~314 obtains the rotation lock failure, and successfully obtain before the rotation lock, suspend the time clock of above-mentioned processor, to suspend its action.
Fig. 4 is the structural representation of rotation lock controller 340.Rotation lock controller 340 comprises Bus Interface Unit 410, arbitration unit 430, steering logic unit 420 and buffer group 440.Wherein, Bus Interface Unit 410 receives the request of from processor 311~314 from bus matrix 320.Steering logic unit 420 receives above-mentioned request from Bus Interface Unit 410, handles above-mentioned request then, the relevant information of the rotation lock of maintenance management simultaneously.If when having processor need suspend action, arbitration unit 430 can send indicator signal to clock controller 330 according to the indication of steering logic unit 420, to suspend the action of processor.
The relevant information of above-mentioned rotation lock comprises the state of rotation lock, processor queue that wait obtains rotation lock and the set strategy or the like of selection processor in formation in the present embodiment.The rotation lock state of present embodiment has only two, is exactly locking or non-locking.Above-mentioned set strategy is in order to determine how to select the processor of obtaining rotation lock at first in formation, can be first in first out (first in first out) in the present embodiment, according to set priority ranking or known alternate manner.If according to priority ranking, this set order also can be included in the relevant information of rotation lock.
How relevant information as for rotation lock stores, and three kinds of modes are arranged.First kind is all to be stored in buffer (register).Second kind is that part is stored in buffer, and part is stored in storer.The third is all to be stored in storer.And Fig. 4 represents is the way that all is stored in buffer.
The buffer group 440 of Fig. 4 is exactly the relevant information that is used for storing rotation lock, comprises obtaining buffer 441, release buffer 442, formation buffer 443, arbitration buffer 444 and priority cache device 445.Wherein, obtain the state that buffer 441 stores rotation lock.Obtain buffer 441, then treat as the request that obtains rotation lock of sending if there is processor to read.Discharge buffer 442 if there is processor that any numerical value is write, then treat as the request that discharges rotation lock of sending.Formation buffer 443 stores the processor queue that wait obtains rotation lock.Arbitration buffer 444 stores the set strategy of selection processor in formation.Priority cache device 445 then stores the set priority ranking of each processor.
What Fig. 5 represented is the rotation lock controller 340 that stores the rotation lock relevant information with the above-mentioned second way.The rotation lock relevant information of some is stored in buffer group 540 in the middle of Fig. 5, and the relevant information of remainder then is stored in the storer 550 that is coupled to steering logic unit 520.Buffer group 540 comprises Address Register 541, to store the address of above-mentioned remainder within storer 550.Certainly, buffer group 540 also comprises other buffer, belongs to the relevant information of buffer group 540 in order to storage.Because steering logic unit 520 is to take rotation lock relevant information within the storer 550 by Address Register 541,, just can distribute or change the storage address of relevant information in real time in the execution time as long as change the content of Address Register 541.So can increase the elasticity in the application.
In using, be built in the storer 550 of rotation lock controller 340, in scope of the present invention, also can use outside memory storage rotation lock relevant information, for example the system storage 350 of Fig. 3.If the use external memory storage, steering logic unit 520 can be by the relevant information of bus matrix 320 access external memory storages.
What at last, Fig. 6 represented is the rotation lock controller 340 that stores the rotation lock relevant information in above-mentioned the third mode.In the middle of Fig. 6, all relevant informations all are stored in the storer 550 that is coupled to steering logic unit 620.And Address Register 640 is to be used for storing the address of rotation lock relevant information within storer 550.Same, except built-in storer, relevant information also can use external memory storage to store.
In sum, the present invention is after processor is obtained the rotation lock failure, suspends its action.Wait at processor finishes then, successfully obtains before the rotation lock, recovers its action.When suspending, processor can not read the rotation lock state from storer as prior art is continuous, thus can save the bus and the memory band width of system, and then save power consumption, improve system effectiveness.The present invention uses rotation lock controller centralized control processor for the taking of rotation lock, thus do not need atomic operation just can reach multiprocessor synchronously.
Present portable multimedia electronic product reaches high-effect and low power consumption for asking, and adopts the multicomputer system of single-chip more.The present invention is specially adapted to the chip multiprocessors system, and the logic that only need increase a little in system-on-a-chip just can be realized.
Though the present invention discloses as above with preferred embodiment; right its is not in order to limit the present invention; any person of ordinary skill in the field; without departing from the spirit and scope of the present invention; when can doing a little change and improvement, so protection scope of the present invention is as the criterion when looking the claim person of defining.

Claims (19)

1. method for synchronous that is used in multicomputer system is characterized in that:
After processor is obtained rotation lock failure, and this processor successfully obtains before this rotation lock, suspends the action of this processor.
2. the method for synchronous that is used in multicomputer system according to claim 1 is characterized in that also comprising the following steps:
Suspend the time clock of this processor, to suspend the action of this processor.
3. the method for synchronous that is used in multicomputer system according to claim 1 is characterized in that also comprising the following steps:
Receive this processor and obtain the request of this rotation lock, the state of passing this rotation lock back is to this processor;
If this rotation lock is in unlocked state, then the state with this rotation lock changes lock-out state into;
If this rotation lock is in the lock state, then suspends the action of this processor, and this processor is entered formation;
Receive the request that this processor discharges this rotation lock, change the state of this rotation lock into unlocked state; And
If there is processor in this formation, to wait for, then in this formation, select a processor, the action of this processor that recovery is selected according to set strategy.
4. the method for synchronous that is used in multicomputer system according to claim 3 is characterized in that this set strategy is that the processor that is introduced into this formation recovers action earlier.
5. the method for synchronous that is used in multicomputer system according to claim 3 is characterized in that this set strategy is according to set priority ranking, selects prepreerence processor in this formation certainly.
6. synchronous device that is used in multicomputer system is characterized in that comprising:
The rotation lock controller receives and handles the request that a plurality of processors are obtained and discharged rotation lock; And
Clock controller, provide a plurality of time clock to above-mentioned these processors, and indication according to this rotation lock controller, after processor is obtained this rotation lock failure, and this processor is successfully obtained before this rotation lock, suspend the time clock of this processor, to suspend the action of this processor.
7. the synchronous device that is used in multicomputer system according to claim 6 is characterized in that this rotation lock controller comprises:
Bus Interface Unit receives above-mentioned these requests from bus matrix;
The steering logic unit, this Bus Interface Unit receives above-mentioned these requests certainly, handles above-mentioned these requests, and the relevant information of this rotation lock of maintenance management; And
Arbitration unit if there is processor need suspend action, then according to the indication of this steering logic unit, sends indicator signal to this clock controller, to suspend the action of this processor.
8. the synchronous device that is used in multicomputer system according to claim 7 is characterized in that this relevant information comprises the state of this rotation lock and the processor queue that wait obtains this rotation lock.
9. a kind of in locking and the non-locking of the synchronous device that is used in multicomputer system according to claim 8, the state that it is characterized in that this rotation lock.
10. the synchronous device that is used in multicomputer system according to claim 8 is characterized in that this relevant information also comprises set strategy, and how this set strategy decision selects the processor of obtaining this rotation lock at first in this formation.
11. the synchronous device that is used in multicomputer system according to claim 8 is characterized in that this relevant information comprises that also above-mentioned these processors obtain the set priority ranking of this rotation lock.
12. the synchronous device that is used in multicomputer system according to claim 7 is characterized in that this rotation lock controller also comprises the buffer group, to store this relevant information.
13. the synchronous device that is used in multicomputer system according to claim 12 is characterized in that this buffer group also comprises:
Obtain buffer, store the state of this rotation lock, and acceptance obtains the request of this rotation lock;
Discharge buffer, accept to discharge the request of this rotation lock; And
The formation buffer stores the processor queue that wait obtains this rotation lock.
14. the synchronous device that is used in multicomputer system according to claim 13, it is characterized in that this buffer group also comprises the arbitration buffer, to store set strategy, how this set strategy decision selects the processor of obtaining this rotation lock at first in this formation.
15. the synchronous device that is used in multicomputer system according to claim 13 is characterized in that this buffer group also comprises the priority cache device, obtains the set priority ranking of this rotation lock to store above-mentioned these processors.
16. the synchronous device that is used in multicomputer system according to claim 7, it is characterized in that this rotation lock controller also comprises the buffer group, to store the wherein part of this relevant information, the remainder of this relevant information then is stored in storer, this buffer group comprises Address Register, to store the address of this remainder in this storer.
17. the synchronous device that is used in multicomputer system according to claim 16 is characterized in that this storer is to be contained in the internal storage of this rotation lock controller and one of to be independent of in the external memory storage outside this rotation lock controller.
18. the synchronous device that is used in multicomputer system according to claim 7 is characterized in that this relevant information is stored in the middle of the storer, and this rotation lock controller also comprises Address Register, to store the address of this relevant information in this storer.
19. the synchronous device that is used in multicomputer system according to claim 18 is characterized in that this storer is to be contained in the internal storage of this rotation lock controller and one of to be independent of in the external memory storage outside this rotation lock controller.
CNB2005100936296A 2005-08-31 2005-08-31 Be used in the method for synchronous and the device of multicomputer system Active CN100561439C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100936296A CN100561439C (en) 2005-08-31 2005-08-31 Be used in the method for synchronous and the device of multicomputer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100936296A CN100561439C (en) 2005-08-31 2005-08-31 Be used in the method for synchronous and the device of multicomputer system

Publications (2)

Publication Number Publication Date
CN1924811A true CN1924811A (en) 2007-03-07
CN100561439C CN100561439C (en) 2009-11-18

Family

ID=37817466

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100936296A Active CN100561439C (en) 2005-08-31 2005-08-31 Be used in the method for synchronous and the device of multicomputer system

Country Status (1)

Country Link
CN (1) CN100561439C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102246155A (en) * 2008-12-10 2011-11-16 飞思卡尔半导体公司 Error detection in a multi-processor data processing system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102246155A (en) * 2008-12-10 2011-11-16 飞思卡尔半导体公司 Error detection in a multi-processor data processing system
CN102246155B (en) * 2008-12-10 2014-10-15 飞思卡尔半导体公司 Error detection in a multi-processor data processing system

Also Published As

Publication number Publication date
CN100561439C (en) 2009-11-18

Similar Documents

Publication Publication Date Title
CN1222890C (en) Dynamic serializing of memory access in multiprocessor system
CN1299201C (en) Methods and apparatus for improving throughput of cache-based embedded processors by switching tasks in response to a cache miss
CN100337206C (en) Queued locks using monitor-memory wait
US11487435B1 (en) System and method for non-volatile memory-based optimized, versioned, log-structured metadata storage with efficient data retrieval
CN1866230A (en) Memory arbitrator with waiting mechanism
CN1783035A (en) Memory based cross compare for cross checked systems
US20110161540A1 (en) Hardware supported high performance lock schema
CN1797348A (en) Predicting contention in a processor
CN1716186A (en) Compare and exchange operation using sleep-wakeup mechanism
US7600076B2 (en) Method, system, apparatus, and article of manufacture for performing cacheline polling utilizing store with reserve and load when reservation lost instructions
CN1959644A (en) System and method of arbitrating access of threads to shared resources within a data processing system
WO2012060889A1 (en) Systems and methods for grouped request execution
CN1746867A (en) Cache filtering using core indicators
CN1908890A (en) Method and apparatus for processing a load-lock instruction using a scoreboard mechanism
EP1994469B1 (en) Method, system, apparatus and article of manufacture for performing cacheline polling utilizing a store and reserve instruction
US20130138885A1 (en) Dynamic process/object scoped memory affinity adjuster
US7581067B2 (en) Load when reservation lost instruction for performing cacheline polling
CN113590508B (en) Dynamic reconfigurable memory address mapping method and device
Fujiki et al. Near-memory data transformation for efficient sparse matrix multi-vector multiplication
CN101078996A (en) System and method for hardware share
US11099790B2 (en) Parallel key value based multithread machine learning leveraging KV-SSDS
CN102681890A (en) Restrictive value delivery method and device applied to thread-level speculative parallelism
CN101075220A (en) Simulator and method for bus arbitraction
CN1924811A (en) Synchronous method and device used in multi-processor system
CN1851651A (en) Method for realizing process priority scheduling for embedded SRAM operating system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant