CN104156260B - The concurrent queue accesses control system that a kind of task based access control is stolen - Google Patents
The concurrent queue accesses control system that a kind of task based access control is stolen Download PDFInfo
- Publication number
- CN104156260B CN104156260B CN201410386814.3A CN201410386814A CN104156260B CN 104156260 B CN104156260 B CN 104156260B CN 201410386814 A CN201410386814 A CN 201410386814A CN 104156260 B CN104156260 B CN 104156260B
- Authority
- CN
- China
- Prior art keywords
- deque
- thread
- access
- task
- undetermined
- 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.)
- Expired - Fee Related
Links
Abstract
The invention discloses a kind of concurrent queue accesses control method stolen of task based access control and system, the concurrent queue accesses control system that task based access control is stolen is by secure access module (1), concurrently access degree monitoring module (2), task scheduling modules (3) and prediction module (4) are constituted.The inventive method is by separating the operation of deque and access control, set up the monitoring mechanism of the concurrent degree of access of queue, during task stealing, according to queue, concurrently degree of access is operated come dynamic self-adapting selection queue, so as to uniformly share the concurrently access of deque in each deque, and the access to each deque ensures the thread-safe for executing operation to deque using obstruction mode.The inventive method supports different task stealing strategies, and the application for the use task stealing operated on parallel random access machine, with higher throughput and acceleration effect.
Description
Technical field
The present invention relates to a kind of operation method of the task dispatcher in multinuclear and many-core processor, more particularly,
Refer to that a kind of access control system of the concurrent queue that task based access control is stolen, the access control are run in task dispatcher.
Background technology
Task dispatcher carrys out the best mode of improving performance typically by thread.Task dispatcher is applied to by multiple non-
The high-performance algorithm of blocked task composition.If task is simply blocked once in a while, then still normally can work.However, such as
Fruit needs continually to block in thread, then can bring about the loss in performance using task dispatcher, because processor exists
Any work can not be done in the case that task is blocked.
Under existing polycaryon processor, task stealing (work stealing) has proven to a kind of efficient scheduling
Concurrent program mode, is a kind of conventional technology for realizing load balancing (load balancing), is used in existing many
During parallel running in system.The mode of task stealing allows each worker thread to safeguard a deque, referred to as Deque, work
Thread first checks for local queue, if local queue non-NULL, takes out the task in local deque, and executes this
Business, if local queue is that sky, worker thread are then stolen by the way of stealing at random from the deque of other worker threads
Take task.In theory, task stealing mode can enable quite to be widely applied acquisition more dominance, but due to being protected using lock mechanism
The correctness that card deque is concurrently accessed, when processor check figure is more, causes worker thread to carry out being also easy to produce during task stealing
Mutually contention causes task dispatcher hydraulic performance decline, and therefore, the key for obtaining actual efficiency is the double of one high efficient and flexible of design
End queue (deque) data structure, the contention during preventing concurrent operations between worker thread and the hydraulic performance decline that causes.
During research shows to be stolen in task Parallel Scheduling, providing flexible support to the selection of task is
Highly important, for example, some irregular figures are calculated, when task is stolen every time, steal multiple tasks and compare and steal one
Individual task is advantageously;Steal half (steal-half) and compare the strategy of (steal-one) task steathily more effectively.
The prevalence of shared drive processor is programming model simple and general due to which, it cause to support shared code and
The parallel software development of data becomes simple.Another name of shared drive processor is parallel random access machine (PRAM).
When parallel random access machine is in the application of weak internal memory (weak memory), because to internal memory fence (memory-fences)
Use expense big relative to the expense of X86, need to avoid internal memory fence used in common tasks parallel dispatch system as far as possible,
But the existing non-realization for blocking concurrent queue is required for the correctness for ensureing algorithm using internal memory fence, and this substantially will drop
Low pass dispatches the performance of system with tasks in parallel.When task stealing strategy such as common tasks parallel dispatch system can take scheduling
Between half executing internal memory fence.
Content of the invention
Excessive in order to solve expense of the parallel random access protocol when deque is dispatched, what the performance that causes reduced asks
Topic, the present invention propose the concurrent queue accesses control system that a kind of task based access control is stolen.Access control of the present invention is to both-end team
The operation of row (deque) and access control are separated, using efficiently extendible concurrent queue accesses control strategy PDACS, if
The deque of meter is without being concerned about the problem concurrently accessed between multithreading so that deque design is more flexible.
Concurrently access degree of the access control system of the present invention by each deque of acquisition, sets up to each deque
Concurrently access degree monitoring mechanism, task is efficiently obtained using prediction work thread success, is realized to deque
The concurrently feedback regulation of access degree, and then make the expense for concurrently accessing of deque uniformly share each deque
On, so that more often obtaining good autgmentability in deque so that systematic function becomes with concurrent thread
Many and increase, ensure that finally by the way of blocking deque executes the thread-safe for operating.
The present invention is the concurrent queue accesses control system that a kind of task based access control is stolen, in PRAM systems, when multiple lines
Journey thread is blocked in same deque deque, the appearance of deque deque can be caused to access intensive, be increased line
Journey steals the expense of task;For deque deque relative thread thread, with two kinds of shapes of ACC=0 or ACC=1
State;Excessive in order to solve expense of the parallel random access protocol when deque deque is dispatched, what the performance that causes reduced asks
Topic, the concurrent queue accesses control system that operation task based access control is stolen in PRAM systems, it is characterised in that:The task based access control
The concurrent queue accesses control system that steals is by secure access module (1), concurrently access degree monitoring module (2), task scheduling mould
Block (3) and prediction module (4) composition;
Task scheduling modules (3) obtain all deque DEQUE={ deque first from PRAM systems1,
deque2,…,dequei,…,dequen, all concurrently access degree S={ s1,s2,…,si,…,snAnd all threads
THREAD={ thread1,thread2,…,threadi,…,threadn};Then:
(A) by task scheduling modules (3) from DEQUE={ deque1,deque2,…,dequei,…,dequenMiddle selection
Remove dequeiFirst undetermined-deque deque in addition1, and record the deque1Concurrently access degree s1;Then, and
Access degree monitoring module (2) is sent out from deque1Extract deque1Corresponding s1, concurrently accessed by queue prediction module (4) foundation
Degree s1To predict first undetermined-deque deque1Intensive with the presence or absence of accessing, access dense prediction relationIfThen first undetermined-deque deque1It is selected, becomes first
Select-deque deque1, execute secure access module (1);IfFirst undetermined-both-end is then abandoned
Queue deque1, execute (B);
(B) by task scheduling modules (3) from DEQUE={ deque1,deque2,…,dequei,…,dequenMiddle selection
Remove dequeiSecond undetermined-deque deque in addition2, and record the deque2Concurrently access degree s2;Then, and
Access degree monitoring module (2) is sent out from deque2Extract deque2Corresponding s2, concurrently accessed by queue prediction module (4) foundation
Degree s2To predict second undetermined-deque deque2Intensive with the presence or absence of accessing, access dense prediction relationIfThen second undetermined-deque deque2It is selected, becomes second
Select-deque deque2, execute secure access module (1);IfSecond undetermined-both-end is then abandoned
Queue deque2, execute (C);
(C) by task scheduling modules (3) from DEQUE={ deque1,deque2,…,dequei,…,dequenMiddle selection
Remove dequeiIn addition last be undetermined-deque dequen, and record the dequenConcurrently access degree sn;Then,
Concurrently access degree monitoring module (2) is from dequenExtract dequenCorresponding sn, concurrently visited by queue prediction module (4) foundation
Degree of asking snTo predict last undetermined-deque dequenIntensive with the presence or absence of accessing, access dense prediction relationIfThen last undetermined-deque dequenIt is selected, becomes last
One is selected-deque dequen, execute secure access module (1);IfThen abandon last to treat
Fixed-deque dequen;
Secure access module (1) judges that first is selected-deque deque1Whether taken by thread, ifDeque is described1Taken by thread, then can be waited untilChange is turned toWhen stop;IfDeque is described1Do not taken by thread, then thread threadiAccessed
Power, to deque1Execute and obtain task operating;
Secure access module (1) judges that second is selected-deque deque2Whether taken by thread, ifDeque is described2Taken by thread, then can be waited untilChange is turned toWhen stop;IfDeque is described2Do not taken by thread, then thread threadiAccessed
Power, to deque2Execute and obtain task operating;
Secure access module (1) judges that last selectes-deque dequenWhether taken by thread, ifDeque is describednTaken by thread, then can be waited untilChange is turned toWhen stop, thread threadiObtain access right;IfDeque is describednDo not taken by thread,
Then thread threadiAccess right is obtained, to dequenExecute and obtain task operating.
The advantage of the concurrent queue accesses control system that task based access control of the present invention is stolen is:
1. deque (deque) operation is isolated by the present invention with Parallel access control, can be to any type of double
End queue (deque) is neatly operated, and is made application be easily achieved task scheduling strategy adaptable with which, is obtained in that
Better performance.
2. because having and only one of which thread to the access of deque (deque) every time in the present invention, in weak internal memory system
In system, it is not necessary to using the big internal memory fence of expense so that the autgmentability that can also obtain in weak memory system.
3. concurrent queue accesses control method of the invention is relative to the concurrent deque method for designing of traditional non-obstruction,
Not only do not limited by queue size, it is not required that complicated Memory recycle mechanism, do not resulted in RAM leakage.
Description of the drawings
Fig. 1 is the structured flowchart of the concurrent queue accesses control system that task based access control of the present invention is stolen.
Fig. 2 is local deque to be operated using the concurrent queue accesses control system that task based access control of the present invention is stolen
Flow chart.
Fig. 3 is outside deque to be operated using the concurrent queue accesses control system that task based access control of the present invention is stolen
Flow chart.
Specific embodiment
Below in conjunction with drawings and Examples, the present invention is described in further detail.
In the present invention, all deques deque of parallel random access machine (PRAM) upper operation are designated as DEQUE, per
Individual deque deque corresponds to concurrently access degree, a thread thread, then the corresponding concurrently access degree of the DEQUE
S is designated as, the corresponding thread of the DEQUE is designated as THREAD.
All deques are expressed as DEQUE={ deque using aggregate form1,deque2,…,dequei,…,
dequen, wherein, deque1Represent first deque, deque2Represent second deque, dequeiRepresent i-th
Deque, dequenRepresent last deque, for convenience of explanation, dequenAny one deque is also referred to as,
N represents the identification number of deque.
All concurrently access degree are expressed as S={ s using aggregate form1,s2,…,si,…,sn, wherein, s1Represent first
Individual deque deque1Concurrently access degree, s2Represent second deque deque2Concurrently access degree, siRepresent i-th
Individual deque dequeiConcurrently access degree, snRepresent last deque dequenConcurrently access degree, for convenience
Illustrate, snAlso referred to as any one concurrently access degree.In the present invention, any one concurrently access degree snIn include currently blocked
Number of threads a and deque dequenIn task number b, then sn=(a, b).
All threads are expressed as THREAD={ thread using aggregate form1,thread2,…,threadi,…,
threadn, wherein, thread1Represent first deque deque1Thread, thread2Represent second deque
deque2Thread, threadiRepresent i-th deque dequeiThread, threadnRepresent last deque
dequenThread, for convenience of explanation, threadnAlso referred to as any one thread.
In the present invention, local deque refers to thread threadiThe both-end team had by (also referred to as local thread)
Row dequei.Outside deque is referred to except deque dequeiOther deques in addition, such as deque1、deque2、
dequen.Task scheduling modules 3 are every time from DEQUE={ deque1,deque2,…,dequei,…,dequenIn only steal one
Individual except dequeiDeque as undetermined-deque.
In PRAM systems, when multiple thread thread are blocked in same deque deque, can cause described double
Queue deque appearance access in end is intensive, increases the expense that thread steals task.Deque deque relative thread thread
For, with two states, state one is accessed by thread by deque deque, referred to as ACC=0;State two is
Deque deque does not have thread accesses, referred to as ACC=1.In PRAM systems, all deques are designated as DEQUE=
{deque1,deque2,…,dequei,…,dequen, all concurrently access degree be designated as S={ s1,s2,…,si,…,snAnd institute
There is thread to be designated as THREAD={ thread1,thread2,…,threadi,…,threadn}.
Shown in Figure 1, the concurrent queue accesses control system that a kind of task based access control of present invention design is stolen is operated in
On parallel random access machine (PRAM), the system is by secure access module 1, concurrently access degree monitoring module 2, task scheduling modules
3 and prediction module 4 constitute.After the concurrent queue accesses control strategy PDACS using the present invention, task scheduling modules 3 are first
DEQUE={ deque are obtained from PRAM systems1,deque2,…,dequei,…,dequen, S={ s1,s2,…,si,…,
snAnd THREAD={ thread1,thread2,…,threadi,…,threadn};Then:
(A) by task scheduling modules 3 from DEQUE={ deque1,deque2,…,dequei,…,dequenIn choose remove
dequeiFirst undetermined-deque deque in addition1, and record the deque1Concurrently access degree s1;Then, concurrently
Access degree monitoring module 2 is from deque1Extract deque1Corresponding s1, by queue prediction module 4 according to concurrently access degree s1Come
First undetermined-deque deque of prediction1Intensive with the presence or absence of accessing, access dense prediction relationIfThen first undetermined-deque deque1It is selected, becomes first
Select-deque deque1, execute secure access module 1;IfFirst undetermined-both-end team is then abandoned
Row deque1, execute (B);
(B) by task scheduling modules 3 from DEQUE={ deque1,deque2,…,dequei,…,dequenIn choose remove
dequeiSecond undetermined-deque deque in addition2, and record the deque2Concurrently access degree s2;Then, concurrently
Access degree monitoring module 2 is from deque2Extract deque2Corresponding s2, by queue prediction module 4 according to concurrently access degree s2Come
Second undetermined-deque deque of prediction2Intensive with the presence or absence of accessing, access dense prediction relationIfThen second undetermined-deque deque2It is selected, becomes second
Select-deque deque2, execute secure access module 1;IfSecond undetermined-both-end team is then abandoned
Row deque2, execute (C);
(C) by task scheduling modules 3 from DEQUE={ deque1,deque2,…,dequei,…,dequenIn choose remove
dequeiIn addition last be undetermined-deque dequen, and record the dequenConcurrently access degree sn;Then, and
Access degree monitoring module 2 is sent out from dequenExtract dequenCorresponding sn, by queue prediction module 4 according to concurrently access degree sn
To predict last undetermined-deque dequenIntensive with the presence or absence of accessing, access dense prediction relationIfThen last undetermined-deque dequenIt is selected, becomes last
One is selected-deque dequen, execute secure access module 1;IfThen abandon that last is undetermined-
Deque dequen;
(D) if task scheduling modules 3 can not be from DEQUE={ deque1,deque2,…,dequei,…,dequenMiddle choosing
Remove dequeiIn addition select-deque, then wait an average task execution time (during described average tasks carrying
Between be design load in PRAM systems) after, restart task scheduling modules 3.
Secure access module 1 judges that first is selected-deque deque1Whether taken by thread, ifDeque is described1Taken by thread, then can be waited untilChange is turned to
When stop;IfDeque is described1Do not taken by thread, then thread threadiAccess right is obtained, to deque1Hold
Row obtains task operating;After execution completes task operating, releasing deque is sent to PRAM systems1Occupied mark;
Secure access module 1 judges that second is selected-deque deque2Whether taken by thread, ifDeque is described2Taken by thread, then can be waited untilChange is turned to
When stop;IfDeque is described2Do not taken by thread, then thread threadiAccess right is obtained, to deque2Hold
Row obtains task operating;After execution completes task operating, releasing deque is sent to PRAM systems2Occupied mark;
Secure access module 1 judges that last selectes-deque dequenWhether taken by thread, ifDeque is describednTaken by thread, then can be waited untilChange is turned toWhen stop, thread threadiObtain access right;IfDeque is describednDo not taken by thread,
Then thread threadiAccess right is obtained, to dequenExecute and obtain task operating;After execution completes task operating, to PRAM systems
Send releasing dequenOccupied mark.
The present invention proposes the concurrent queue accesses control method that a kind of task based access control is stolen, the method operate in parallel with
In machine addressing machine (PRAM), described PRAM is divided into local deque and outside both-end team to deque (deque) operation
Two aspects of row;Concurrent queue accesses control strategy PDACS is concretely comprised the following steps:
Shown in Figure 2, the task stealing of outside deque is processed using concurrent queue accesses control strategy PDACS
Step is:
Step 101:The monitoring of deque concurrency
As local thread threadiDeque dequeiIn, during without any task, then selected by task scheduling modules 3
Select any one undetermined-deque dequen;
Then by concurrently access degree monitoring module 2 from undetermined-deque dequenIn extract concurrently access degree sn
=(a, b);Subsequent execution step 102;
In the present invention, concurrent access degree sn=(a, b) is that the access situation for following deque in real time updates, each
Deque has a corresponding concurrently access degree, and can obtain recording from concurrently access degree etc. both-end to be visited
The number of threads of queue.
Step 102:Can prediction access of the effective acquisition to deque
Prediction module 4 is according to concurrently access degree snTo predict undetermined-deque dequenClose with the presence or absence of accessing
Collection, accesses dense prediction relationIfThen undetermined-deque dequen
It is selected, becomes selected-deque dequen, execute secure access module 1;IfDescribed treat then is abandoned
Fixed-deque dequen.
In the present invention,When showing that thread conducts interviews to undetermined-deque, synchronization overhead is little;Then show that thread now conducts interviews to undetermined-deque, synchronization overhead is big, when needing to wait longer
Between.
In the present invention, information of forecasting is stolenCalculate when simply stealing to deque, not right at ordinary times
Deque conducts interviews, then need not be in real time to thisValue carries out calculating renewal, and each queue has corresponding
Steal information of forecasting.
Step 103:Obtain the access right of queue
As local thread threadiNeed to selecting-deque dequenWhen carrying out acquisition task operating, need to obtain
dequenAccess right
IfDeque is describednDo not taken by thread, then thread threadiObtain access right, execution step
104;
IfDeque is describednTaken by thread, then can be waited untilChange is turned toWhen stop, thread threadiObtain access right, subsequent execution step 104.
Step 104:The access queue of obstruction
In local thread threadiAfter obtaining access right, selected-deque deque can be marked1、deque2Or
dequenBy thread threadiTake;Until threadiAfter completing to obtain task operating, can just discharge to selecting-deque
deque1、deque2Or dequenOccupancy mark.
Finally, secure access module 1 sends selected-deque deque to PRAM systems1、deque2Or dequenNot
The information taken by thread.In the present invention, after occupancy mark is released from ,-deque deque is selected1、deque2Or
dequenIdentity revert to deque deque operated on parallel random access machine (PRAM).
Shown in Figure 3, the task stealing of local deque is processed using concurrent queue accesses control strategy PDACS
Step is:
Step 201:Obtain the access right of queue
As local thread threadiDeque dequeiIn when there is task, judge dequeiAccess right
IfDeque is describediDo not taken by thread, then thread threadiObtain access right, execution step
202;
IfDeque is describediTaken by thread, then can be waited untilChange is turned toWhen stop, thread threadiObtain access right, subsequent execution step 202.
Step 202:The access queue of obstruction
In local thread threadiAfter obtaining access right, deque can be markediDeque is by thread threadiTake;Directly
To threadiAfter completing to obtain task operating, just can discharge to dequeiOccupancy mark;Finally, secure access module 1 to
PRAM systems send dequeiThe information not taken by thread.
Embodiment 1
By applying concurrent queue accesses control strategy PDACS's in the parallel tables Cilk of shared memory multiprocessor
Access control method, and experiment, standard testing of the experiment test collection using MIT Cilk is compared with original Cilk parallel tables
Set, experimental situation platform is the tide server with one piece of intel xeon phi 7110P series processors, the process
Device one has 61 processor cores, after opening CPU hyperthreads, has altogether 244 logic processor cores, can support simultaneously
244 physical threads are concurrently executed, and server OS is Red Hat Linux 6.3.
Using MIT Cilk test programs, the Cilk parallel tables that is tested under 244 threads respectively and PDACS are put down parallel
The time of the execution test program of platform, the compiler that test program is used when compiling isC++Composer XE 2013
SP1, optimization level options during compiling are-O2, and test result shows that PDACS parallel tables performances are compared Cilk parallel tables and carried
Rise 10% or so.
Claims (2)
1. the concurrent queue accesses control system that a kind of task based access control is stolen, in PRAM systems, operation task based access control is stolen simultaneously
Send out queue accesses control system, it is characterised in that:The concurrent queue accesses control system that the task based access control is stolen is visited by safety
Ask module (1), concurrently access degree monitoring module (2), task scheduling modules (3) and prediction module (4) are constituted;
Task scheduling modules (3) obtain all deque DEQUE={ deque first from PRAM systems1,deque2,…,
dequei,…,dequen, all concurrently access degree S={ s1,s2,…,si,…,snAnd all thread THREAD=
{thread1,thread2,…,threadi,…,threadn};Wherein, deque1Represent first deque, deque2Table
Show second deque, dequeiRepresent i-th deque, dequenRepresent that last deque, n represent both-end
The identification number of queue;s1Represent first deque deque1Concurrently access degree, s2Represent second deque deque2
Concurrently access degree, siRepresent i-th deque dequeiConcurrently access degree, snRepresent last deque
dequenConcurrently access degree, the snIn include currently blocked number of threads a and deque dequenIn task
Number b, then sn=(a, b);Deque DEQUE={ the deque1,deque2,…,dequei,…,dequenInclude
Local deque and outside deque;Then:
(A) by task scheduling modules (3) from DEQUE={ deque1,deque2,…,dequei,…,dequenIn choose remove
dequeiFirst undetermined-deque deque in addition1, and record the deque1Concurrently access degree s1;Then, concurrently
Access degree monitoring module (2) is from deque1Extract deque1Corresponding s1, by queue prediction module (4) according to concurrently access degree
s1To predict first undetermined-deque deque1Intensive with the presence or absence of accessing, access dense prediction relationA represents that currently blocked number of threads, b represent deque dequenIn task number,
IfThen first undetermined-deque deque1It is selected, becomes first and select-deque
deque1, execute secure access module (1);IfFirst undetermined-deque deque is then abandoned1, execute
(B);
(B) by task scheduling modules (3) from DEQUE={ deque1,deque2,…,dequei,…,dequenIn choose remove
dequeiSecond undetermined-deque deque in addition2, and record the deque2Concurrently access degree s2;Then, concurrently
Access degree monitoring module (2) is from deque2Extract deque2Corresponding s2, by queue prediction module (4) according to concurrently access degree
s2To predict second undetermined-deque deque2Intensive with the presence or absence of accessing, access dense prediction relationA represents that currently blocked number of threads, b represent deque dequenIn task number,
IfThen second undetermined-deque deque2It is selected, becomes second and select-deque
deque2, execute secure access module (1);IfSecond undetermined-deque deque is then abandoned2, execute
(C);
(C) by task scheduling modules (3) from DEQUE={ deque1,deque2,…,dequei,…,dequenIn choose remove
dequeiIn addition last be undetermined-deque dequen, and record the dequenConcurrently access degree sn;Then, and
Access degree monitoring module (2) is sent out from dequenExtract dequenCorresponding sn, concurrently accessed by queue prediction module (4) foundation
Degree snTo predict last undetermined-deque dequenIntensive with the presence or absence of accessing, access dense prediction relationA represents that currently blocked number of threads, b represent deque dequenIn task number,
IfThen last undetermined-deque dequenIt is selected, becomes last and select-deque
dequen, execute secure access module (1);IfLast undetermined-deque deque is then abandonedn;
Secure access module (1) judges that first is selected-deque deque1Whether taken by thread, ifDeque is described1Taken by thread, then can be waited untilChange is turned toWhen stop;IfDeque is described1Do not taken by thread, then thread threadiAccessed
Power, to deque1Execute and obtain task operating;
Secure access module (1) judges that second is selected-deque deque2Whether taken by thread, ifDeque is described2Taken by thread, then can be waited untilChange is turned toWhen stop;IfDeque is described2Do not taken by thread, then thread threadiAccessed
Power, to deque2Execute and obtain task operating;
Secure access module (1) judges that last selectes-deque dequenWhether taken by thread, ifDeque is describednTaken by thread, then can be waited untilChange is turned toWhen stop, thread threadiObtain access right;IfDeque is describednDo not taken by thread,
Then thread threadiAccess right is obtained, to dequenExecute and obtain task operating;
For the task stealing of outside deque includes the following steps:
Step 101:The monitoring of deque concurrency
As local thread threadiDeque dequeiIn, during without any task, then selected by task scheduling modules (3)
Any one undetermined-deque dequen;
Then by concurrently access degree monitoring module (2) from undetermined-deque dequenIn extract concurrently access degree sn=
(a,b);Subsequent execution step 102;
Step 102:Can prediction access of the effective acquisition to deque
Prediction module (4) is according to concurrently access degree snTo predict undetermined-deque dequenIt is intensive with the presence or absence of accessing,
Access dense prediction relationA represents that currently blocked number of threads, b represent deque
dequenIn task number, ifThen undetermined-deque dequenIt is selected, becomes selected-bis-
End queue dequen, execute secure access module (1);IfUndetermined-deque deque is then abandonedn;
Step 103:Obtain the access right of queue
As local thread threadiNeed to select-deque deque to describednWhen carrying out acquisition task operating, need to obtain
dequenAccess right
IfDeque is describednDo not taken by thread, then thread threadiObtain access right, execution step 104;
IfDeque is describednTaken by thread, then can be waited untilChange is turned toWhen stop, thread threadiObtain access right, subsequent execution step 104;
Step 104:The access queue of obstruction
In local thread threadiAfter obtaining access right, selected-deque deque can be markednBy thread threadiAccount for
With;Until threadiAfter completing to obtain task operating, can just discharge to selecting-deque dequenOccupancy mark;
Finally, secure access module (1) sends selected-deque deque to PRAM systemsnThe information not taken by thread;Right
The following steps are included in the task stealing of local deque:
Step 201:Obtain the access right of queue
As local thread threadiDeque dequeiIn when there is task, judge dequeiAccess right
IfDeque is describediDo not taken by thread, then thread threadiObtain access right, execution step 202;
IfDeque is describediTaken by thread, then can be waited untilChange is turned toWhen stop, thread threadiObtain access right, subsequent execution step 202;
Step 202:The access queue of obstruction
In local thread threadiAfter obtaining access right, deque can be markediDeque is by thread threadiTake;Until
threadiAfter completing to obtain task operating, just can discharge to dequeiOccupancy mark;Finally, secure access module (1) to
PRAM systems send dequeiThe information not taken by thread.
2. the concurrent queue accesses control system that task based access control according to claim 1 is stolen, it is characterised in that:Task is adjusted
Degree module (3) is every time from DEQUE={ deque1,deque2,…,dequei,…,dequenIn only steal one except dequei's
Deque is used as undetermined-deque.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410386814.3A CN104156260B (en) | 2014-08-07 | 2014-08-07 | The concurrent queue accesses control system that a kind of task based access control is stolen |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410386814.3A CN104156260B (en) | 2014-08-07 | 2014-08-07 | The concurrent queue accesses control system that a kind of task based access control is stolen |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104156260A CN104156260A (en) | 2014-11-19 |
CN104156260B true CN104156260B (en) | 2017-03-15 |
Family
ID=51881766
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410386814.3A Expired - Fee Related CN104156260B (en) | 2014-08-07 | 2014-08-07 | The concurrent queue accesses control system that a kind of task based access control is stolen |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104156260B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107220111B (en) * | 2017-04-28 | 2019-08-09 | 华中科技大学 | A kind of method for scheduling task that task based access control is stolen and system |
CN109408490A (en) * | 2018-09-29 | 2019-03-01 | 武汉斗鱼网络科技有限公司 | A kind of regular method, apparatus of array, terminal and readable medium |
CN110083445B (en) * | 2019-04-21 | 2023-04-25 | 哈尔滨工业大学 | Multithreading deterministic execution method based on weak memory consistency |
CN110908794B (en) * | 2019-10-09 | 2023-04-28 | 上海交通大学 | Task stealing method and system based on task stealing algorithm |
CN115292025A (en) * | 2022-09-30 | 2022-11-04 | 神州数码融信云技术服务有限公司 | Task scheduling method and device, computer equipment and computer readable storage medium |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103677760A (en) * | 2013-12-04 | 2014-03-26 | 北京航空航天大学 | Event parallel controller based on Openflow and event parallel processing method thereof |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6823351B1 (en) * | 2000-05-15 | 2004-11-23 | Sun Microsystems, Inc. | Work-stealing queues for parallel garbage collection |
-
2014
- 2014-08-07 CN CN201410386814.3A patent/CN104156260B/en not_active Expired - Fee Related
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103677760A (en) * | 2013-12-04 | 2014-03-26 | 北京航空航天大学 | Event parallel controller based on Openflow and event parallel processing method thereof |
Non-Patent Citations (2)
Title |
---|
Correct and efficient work-stealing for weak memory models;Lê N M et al;《The 18th ACM SIGPLAN symposium on Principles and practice of parallel programming》;20131231;69-80 * |
Scheduling parallel programs by work stealing with private deques;Acar U A et al;《The 18th ACM SIGPLAN symposium on Principles and practice of parallel programming》;20131231;219-228 * |
Also Published As
Publication number | Publication date |
---|---|
CN104156260A (en) | 2014-11-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104156260B (en) | The concurrent queue accesses control system that a kind of task based access control is stolen | |
US20220027210A1 (en) | Work Stealing in Heterogeneous Computing Systems | |
CN102360309B (en) | Scheduling system and scheduling execution method of multi-core heterogeneous system on chip | |
Wang et al. | Concurrent analytical query processing with GPUs | |
US8775837B2 (en) | System and method for enabling turbo mode in a processor | |
US8676976B2 (en) | Microprocessor with software control over allocation of shared resources among multiple virtual servers | |
CN101799773B (en) | Memory access method of parallel computing | |
van Dijk et al. | Lace: non-blocking split deque for work-stealing | |
CN103729480B (en) | Method for rapidly finding and scheduling multiple ready tasks of multi-kernel real-time operating system | |
CN106406987A (en) | Task execution method and apparatus in cluster | |
DE112012002465T5 (en) | Graphics processor with non-blocking concurrent architecture | |
JP2010532530A5 (en) | ||
RU2012148586A (en) | FILTRATION OF SOFTWARE INTERRUPTION IN TRANSACTION PERFORMANCE | |
JP2012150583A5 (en) | ||
CN101833438A (en) | General data processing method based on multiple parallel | |
CN106445688A (en) | MIC computing platform-based NLM parallel image enhancement method | |
CN106445631B (en) | Method and system for deploying virtual machine and physical server | |
CN109144685B (en) | Architecture and services to support reconfigurable synchronization in a multi-processing system | |
Awatramani et al. | Increasing GPU throughput using kernel interleaved thread block scheduling | |
CN104156316B (en) | A kind of method and system of Hadoop clusters batch processing job | |
CN102915292A (en) | Communication method based on multi-core processor and detection method and control method thereof | |
CN113806078A (en) | Memory scheduling method for edge ai inference framework | |
KR20220085366A (en) | Controller for vehicle and operating system scheduling method thereof | |
CN110083445B (en) | Multithreading deterministic execution method based on weak memory consistency | |
Falt et al. | Locality aware task scheduling in parallel data stream processing |
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 | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20210419 Address after: 100160, No. 4, building 12, No. 128, South Fourth Ring Road, Fengtai District, Beijing, China (1515-1516) Patentee after: Kaixi (Beijing) Information Technology Co.,Ltd. Address before: 100191 Haidian District, Xueyuan Road, No. 37, Patentee before: BEIHANG University |
|
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20170315 Termination date: 20210807 |