CN102063291B - Multilevel parallel execution method of speculation thread - Google Patents

Multilevel parallel execution method of speculation thread Download PDF

Info

Publication number
CN102063291B
CN102063291B CN 201110006560 CN201110006560A CN102063291B CN 102063291 B CN102063291 B CN 102063291B CN 201110006560 CN201110006560 CN 201110006560 CN 201110006560 A CN201110006560 A CN 201110006560A CN 102063291 B CN102063291 B CN 102063291B
Authority
CN
China
Prior art keywords
thread
parallel
foresight
executed
module
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
Application number
CN 201110006560
Other languages
Chinese (zh)
Other versions
CN102063291A (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.)
University of Shanghai for Science and Technology
Original Assignee
University of Shanghai for Science and Technology
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 University of Shanghai for Science and Technology filed Critical University of Shanghai for Science and Technology
Priority to CN 201110006560 priority Critical patent/CN102063291B/en
Publication of CN102063291A publication Critical patent/CN102063291A/en
Application granted granted Critical
Publication of CN102063291B publication Critical patent/CN102063291B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a multilevel parallel execution method of a speculation thread. The method is characterized by comprising the following steps of: (1) extracting a speculation thread STi which can be executed in parallel from a serial program required to be executed; (2) preprocessing the extracted speculation thread STi which can be executed in parallel and marking a module which can be executed in parallel; (3) executing the speculation thread STi generated in the step (2) according to a speculation parallel execution rule until the thread execution is finished; then judging whether the executed speculation thread STi is needed to be restarted, and if so, executing the thread by adopting a non-speculation thread; and if not, submitting the speculation thread. The method can indirectly eliminate necessary data synchronization and data dependency, thereby effectively avoiding computer resource waste caused by thread waiting and swap-in and swap-out of thread resources from a processor and an internal memory, sufficiently utilizing the computer resources and improving the execution efficiency of the program.

Description

A kind of multistage parallel manner of execution of foresight thread
Technical field
The present invention relates to a kind of multistage parallel manner of execution of foresight thread, belong to field of computer technology.
Background technology
Along with the continuous development of computer technology, (Chip Multi-Processors, CMP) technology has become one of gordian technique that improves processor performance to the monolithic polycaryon processor, is widely used in every field.The monolithic multi-core technology is come executed in parallel by integrated a plurality of simple relatively microcontroller cores on chip piece, improves the performance of system, and reduces the power consumption of processor.The key of utilizing the CMP technology to improve system performance is to bring into play the parallel processing advantage of a plurality of microcontroller cores, the execution efficient of raising program on polycaryon processor comprehensively.
Thread-level prediction (Thread-Level Speculative, TLS) technology, under uncertain situation, create in advance and guess that carrying out some may need the thread carried out in the future, by prediction carry out and corresponding prediction error detection mechanism can remove unnecessary data synchronous, find and safeguard that real data are relevant, thereby reduce the difficulty of thread dividing, become and improve effective way that Thread-Level Parallelism is carried out.But it is synchronous still to exist some data necessary between the thread that utilizes foresight technology to extract, and the wait that this will form when the thread executed in parallel between the thread influences the efficient that thread parallel is carried out.Therefore, how to optimize thread execution, avoiding factor is one of gordian technique in the serial program parallelization according to forming thread waits synchronously.
Summary of the invention
The objective of the invention is to have problems at prior art, provide a kind of multistage parallel manner of execution of foresight thread, this method reduction factor effectively takes full advantage of the resource of polycaryon processor according to the probability that causes thread waits synchronously, improves the executed in parallel efficient of program.
For achieving the above object, design of the present invention is: according to still exist in the foresight thread of executed in parallel can executed in parallel module (program statement sequence), so just can be by foresight thread be carried out at processing, mark can executed in parallel module, foresight thread factor in executed in parallel is bide one's time according to needing synchronously to wait, do not wait for, but then the module of other executed in parallel in searching and the execution foresight thread, in conjunction with the execution of prediction parallel thread, improve the executed in parallel efficient of program effectively.
According to above-mentioned inventive concept, the present invention adopts following technical proposals:
A kind of multistage parallel manner of execution of foresight thread is characterized in that, the concrete operations step is as follows:
(1) but, from the serial program that needs are carried out, extract the foresight thread ST of executed in parallel i
(2), to step (1) but the foresight thread ST of the executed in parallel that extracts in described iCarry out pre-service, but mark the module of executed in parallel.
(3), the foresight thread ST to generating in the step (2) iCarry out by prediction executed in parallel rule, intact until this thread execution; Judge the foresight thread ST that executes then iWhether need to restart, if need restart, then carry out this thread with non-foresight thread; Otherwise, submit this prediction thread to.
Described in the above-mentioned steps (2) to step (1) but in the foresight thread ST of the executed in parallel that extracts iCarry out pre-service, but mark the module of executed in parallel, its concrete steps are as follows:
(21), detect foresight thread ST i, from foresight thread ST iBut in detect the module M of executed in parallel 1, M 2..., M n
(22), detected each parallel module M in step (21) kFront and back insert parallel module respectively and begin to identify PMS nFinish sign PME with parallel module n
The module that walks abreast in the foresight thread described in the above-mentioned steps (2) refers to, is present in can carry out separately in the foresight thread, and does not influence some statement sequences of other statement execution or the module that several program statements are formed.
Each foresight thread ST to generating in the step (2) described in the above-mentioned steps (3) iPress the executed in parallel rule executed in parallel of foresight thread, intact until this thread execution, judge the foresight thread ST that executes then iWhether need to restart, if need restart, then carry out this thread with non-foresight thread; Otherwise, submit this prediction thread to, its concrete operations step is as follows:
(31), according to the forward foresight thread of the sequential semantics principle of scheduling earlier, from the candidate wait for scheduling foresight thread select foresight thread ST iTo the nuclear of free time;
(32), carry out foresight thread ST iAnd detect whether the semaphore appearance that needs thread synchronization is arranged, if the semaphore of thread synchronization occurs, then forward step (33) to; Otherwise, go to step (37);
(33), to the pending sign Wait (T such as current statement interpolation of the foresight thread STi that carrying out in the step (32) Jv), the thread ST synchronous to needs jAdd and arouse sign Awake (T Iv), step (34) is changeed in the sign back;
(34), the thread ST in the detection step (33) iBut the module that whether has the executed in parallel of not carrying out, but if detect the module M that there is executed in parallel in thread k, execution in step (35) then, otherwise this thread ST iEnter waiting status, wait for thread ST jSignal identification Awake (T is aroused in initiation Iv) after, change step (36);
(35), carry out above-mentioned steps (34) but in detected executed in parallel module M k, the back representation module that is finished is that sign is crossed in executed, namely uses PMO kReplace PMS nWith PME n, detect thread simultaneously and arouse signal and whether arrive, if arouse the signal no show, then forward step (34) to, continue to carry out; Arrive if arouse signal, then change step (36);
(36), jump to foresight thread STi etc. Wait to be identified (Tjv) locate continue to carry out, change step (37) then;
(37), judge whether foresight thread STi is finished, if foresight thread STi is not finished, then forwards (32) to and continue to carry out, otherwise, forward step (38) to;
(38), judge whether thread STi prediction lost efficacy, if outlook failure changes step (39); Otherwise, forward step (40) to;
(39), to this thread reboot operation, and after executing thread STi, change step (40);
(40), foresight thread STi is carried out correlated results submits the execution end to.
The multistage parallel manner of execution of a kind of foresight thread of the present invention compared with the prior art, have following apparent outstanding substantive distinguishing features and remarkable advantage: the data sync that the elimination that this method can be indirect is essential and data rely on, effectively avoided causing the computer resource waste because thread waits and thread resources swap out from changing to of processor and internal memory, take full advantage of computer resource, improved executing efficiency.
Description of drawings
Fig. 1 is the process flow diagram of the multistage parallel manner of execution of a kind of foresight thread of the present invention;
Fig. 2 is the process flow diagram of step among Fig. 1 (3).
Embodiment
The present invention is further detailed explanation below in conjunction with specification drawings and specific embodiments.
The applied environment of the described scheme of present embodiment is the parallel foresight thread level execution environment towards polycaryon processor, and present embodiment does not limit polycaryon processor framework in the described technical scheme applied environment.
With reference to Fig. 1, the multistage parallel manner of execution of a kind of foresight thread of the present invention, its concrete operations step is as follows:
But step 101, utilize the thread-level foresight technology from the serial program that needs are carried out, to extract the thread STi of executed in parallel.
Step 102, but each foresight thread that extracts executed in parallel is carried out pre-service, but mark the module of executed in parallel, its concrete steps are as follows:
Step 1021, detect foresight thread STi, but from foresight thread STi, detect the module M of executed in parallel 1, M 2..., M n
Step 1022, in step 1021 detected each parallel module M kFront and back insert parallel module respectively and begin to identify PMS nFinish sign PME with parallel module n
Step 103, each foresight thread ST to generating 1Carry out according to prediction executed in parallel rule, intact until this thread execution, judge the foresight thread ST that executes then iWhether need to restart, if need restart, then carry out this thread with non-foresight thread; Otherwise, submit this prediction thread to.With reference to Fig. 2, its concrete operations step is as follows:
Step 1031, according to the forward foresight thread of the sequential semantics principle of scheduling earlier, from the candidate waits for the foresight thread of scheduling, select thread to the kernel of free time;
Step 1032, execution foresight thread STi also detect whether the semaphore appearance that needs thread synchronization is arranged, if the semaphore of thread synchronization occurs, and commentaries on classics step 1033; Otherwise, go to step 1037;
Step 1033, to the pending sign Wait (T such as current statement interpolation of the foresight thread STi in the step 1032 Jv), the thread ST synchronous to needs jAdd and arouse sign Awake (T Iv), go to step 1034 then;
Foresight thread ST in step 1034, the detection step 1033 after the sign iBut the module that whether has the executed in parallel of not carrying out, but if detect the module M that there is executed in parallel in thread k, then execution in step 1035, otherwise this thread ST iEnter waiting status, wait for thread ST jSignal identification Awake (T is aroused in initiation Iv) after, change step 1036;
But detected executed in parallel module M in step 1035, the execution above-mentioned steps 1033 k, the back representation module that is finished is that sign is crossed in executed, namely uses PMO kReplace PMS nWith PME n, detect thread simultaneously and arouse signal and whether arrive, if arouse the signal no show, then forward step 1034 to, continue to carry out; Arrive if arouse signal, then change step 1036;
Step 1036, jump to foresight thread STi etc. Wait to be identified (Tjv) locate continue to carry out, change step 1037 then;
Step 1037, judge whether foresight thread STi is finished, if foresight thread STi is not finished, then forwards (1032) to and continue to carry out; Otherwise, forward step (1038) to;
Step 1038, judge whether thread STi prediction lost efficacy, if outlook failure changes step (1039); Otherwise, forward step (1040) to;
Step 1039, to this thread reboot operation, and after executing thread STi, change step 1040.
Step 1040, foresight thread STi is carried out correlated results submit to, carry out and finish.
More than to the multistage parallel manner of execution of this a kind of line of looking forward to the prospect, be described in detail.This paper sets forth just for helping to understand method of the present invention and core concept in conjunction with Figure of description and specific embodiment; Simultaneously, for one of ordinary skill in the art, according to method of the present invention and thought, the part that on embodiment and range of application, all can change, in sum, this description should not be construed as limitation of the present invention.

Claims (3)

1. the multistage parallel manner of execution of a foresight thread is characterized in that operation steps is as follows:
(1) but, from the serial program that needs are carried out, extract the foresight thread ST of executed in parallel i
(2), to step (1) but in the foresight thread ST of the executed in parallel that extracts iCarry out pre-service, but mark the module of executed in parallel;
(3), the foresight thread ST to generating in the step (2) iCarry out by prediction executed in parallel rule, intact until this thread execution; Judge the foresight thread ST that executes then iWhether need to restart, if need restart, then carry out this thread with non-foresight thread; Otherwise, submit this prediction thread to, concrete steps are as follows:
(31), according to the forward foresight thread of the sequential semantics principle of scheduling earlier, from the candidate waits for the foresight thread of scheduling, select foresight thread ST iTo the nuclear of free time;
(32), carry out foresight thread ST iAnd detect whether the semaphore appearance that needs thread synchronization is arranged, if the semaphore of thread synchronization occurs, then forward step (33) to; Otherwise, go to step (37);
(33), to the pending sign Wait (T such as current statement interpolation of the foresight thread STi that carrying out in the step (32) Jv), the thread ST synchronous to needs jAdd and arouse sign Awake (T Iv), step (34) is changeed in the sign back;
(34), the thread ST in the detection step (33) iBut the module that whether has the executed in parallel of not carrying out, but if detect the module M that there is executed in parallel in thread k, execution in step (35) then, otherwise this thread ST iEnter waiting status, wait for thread ST jSignal identification Awake (T is aroused in initiation Iv) after, change step (36);
(35), carry out above-mentioned steps (34) but in detected executed in parallel module M k, the back representation module that is finished is that sign is crossed in executed, namely uses PMO kReplace PMS nWith PME n, detect thread simultaneously and arouse signal and whether arrive, if arouse the signal no show, then forward step (34) to, continue to carry out; Arrive if arouse signal, then change step (36);
(36), jump to foresight thread STi etc. Wait to be identified (Tjv) locate continue to carry out, change step (37) then;
(37), judge whether foresight thread STi is finished, if foresight thread STi is not finished, then forwards (32) to and continue to carry out, otherwise, forward step (38) to;
(38), judge whether thread STi prediction lost efficacy, if outlook failure changes step (39); Otherwise, forward step (40) to;
(39), to this thread reboot operation, and after executing thread STi, change step (40)
(40), foresight thread STi is carried out correlated results submits the execution end to.
2. the multistage parallel manner of execution of a kind of foresight thread according to claim 1 is characterized in that, described in the above-mentioned steps (2) to step (1) but in the foresight thread ST of the executed in parallel that extracts iCarry out pre-service, but mark the module of executed in parallel, its concrete steps are as follows:
(21), detect foresight thread ST i, from foresight thread ST iBut in detect the module M of executed in parallel 1, M 2..., M n
(22), detected each parallel module M in step 21 kFront and back insert parallel module respectively and begin to identify PMS nFinish sign PME with parallel module n
3. the multistage parallel manner of execution of a kind of foresight thread according to claim 1, it is characterized in that, the module that walks abreast in the foresight thread described in the above-mentioned steps (2) refers to, be present in can carry out separately in the foresight thread, and do not influence some statement sequences of other statement execution or the module that several program statements are formed.
CN 201110006560 2011-01-13 2011-01-13 Multilevel parallel execution method of speculation thread Expired - Fee Related CN102063291B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110006560 CN102063291B (en) 2011-01-13 2011-01-13 Multilevel parallel execution method of speculation thread

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110006560 CN102063291B (en) 2011-01-13 2011-01-13 Multilevel parallel execution method of speculation thread

Publications (2)

Publication Number Publication Date
CN102063291A CN102063291A (en) 2011-05-18
CN102063291B true CN102063291B (en) 2013-08-28

Family

ID=43998582

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110006560 Expired - Fee Related CN102063291B (en) 2011-01-13 2011-01-13 Multilevel parallel execution method of speculation thread

Country Status (1)

Country Link
CN (1) CN102063291B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102520915B (en) * 2011-11-25 2014-04-02 华为技术有限公司 Method and device for threading serial program in nonuniform memory access system
CN102968295A (en) * 2012-11-28 2013-03-13 上海大学 Speculation thread partitioning method based on weighting control flow diagram

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101807144A (en) * 2010-03-17 2010-08-18 上海大学 Prospective multi-threaded parallel execution optimization method
CN101814019A (en) * 2010-03-25 2010-08-25 上海大学 Method for identifying thread with outlook failure
CN101833440A (en) * 2010-04-30 2010-09-15 西安交通大学 Speculative multithreading memory data synchronous execution method under support of compiler and device thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2469822B (en) * 2009-04-28 2011-04-20 Imagination Tech Ltd Method and apparatus for scheduling the issue of instructions in a multithreaded microprocessor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101807144A (en) * 2010-03-17 2010-08-18 上海大学 Prospective multi-threaded parallel execution optimization method
CN101814019A (en) * 2010-03-25 2010-08-25 上海大学 Method for identifying thread with outlook failure
CN101833440A (en) * 2010-04-30 2010-09-15 西安交通大学 Speculative multithreading memory data synchronous execution method under support of compiler and device thereof

Also Published As

Publication number Publication date
CN102063291A (en) 2011-05-18

Similar Documents

Publication Publication Date Title
CN101807144B (en) Prospective multi-threaded parallel execution optimization method
CN109919310B (en) GPU memory optimization method and system for deep learning training task
US20110209153A1 (en) Schedule decision device, parallel execution device, schedule decision method, and program
US20130346781A1 (en) Power Gating Functional Units Of A Processor
CN101593096B (en) Method for implementing elimination of dependencies in shared register
CN103034538B (en) Multi-level cache processing method of drive program in embedded type operation system
CN102222022A (en) Real-time task scheduling method based on multicore processor
US9740498B2 (en) Opportunistic multi-thread method and processor
CN102063291B (en) Multilevel parallel execution method of speculation thread
CN101655783B (en) Forward-looking multithreading partitioning method
CN103761499B (en) Based on the bar code recognition of multi-core DSP
US11269693B2 (en) Method, apparatus, and electronic device for improving CPU performance
WO2014004736A4 (en) A method or apparatus to perform footprint-based optimization simultaneously with other steps
CN102662635A (en) Very long instruction word variable long instruction realization method and processor for realizing same
CN110083445B (en) Multithreading deterministic execution method based on weak memory consistency
CN102012844A (en) Chip multi-processor (CMP) system-oriented thread scheduling method
CN103413196B (en) The solving job shop scheduling problem based on relation chain improved crucial external coordination operation discrimination method
CN101482831A (en) Method and equipment for concomitant scheduling of coexisting threading in multi-threading computer system
CN109522126A (en) Data optimization methods and device towards Thread-Level Parallelism in shared drive coenocytism
CN101814019B (en) Method for identifying thread with outlook failure
CN101520724B (en) Speculative thread particle with restart optimization and restart optimization method thereof
CN102012841B (en) Restart scheduling method of failure look-ahead threads
Pericas et al. A two-level load/store queue based on execution locality
CN114297291B (en) Transaction combination-based parallel execution method and device
Dufresne Camaro et al. Appearance shock grammar for fast medial axis extraction from real images

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
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: 20130828

Termination date: 20160113