Font Size: a A A

Research On Mechanism Of Thread-Level Speculation Based On Pthreads

Posted on:2022-03-01Degree:MasterType:Thesis
Country:ChinaCandidate:H YangFull Text:PDF
GTID:2518306515956399Subject:Master of Engineering
Abstract/Summary:PDF Full Text Request
With the development of Moore's Law,the processor has entered the multi-core era.The parallelization of serial programs brings new challenges.Traditional parallel technology needs to ensure that there is no data dependency between different parallel threads.The parallel strategy is relatively conservative and it encounters bottlenecks in program acceleration.Thread-level speculation(TLS)is an automated parallel technology that explores the inherent parallelism of programs at runtime in a radical way.It divides data-dependent serial programs into multi-threaded programs and uses them on a multi-core platform.However,the existing TLS model will generate additional overhead,and even when frequent data dependencies are violated,it may even offset the performance gains brought by TLS.In response to the above problems,this thesis proposes a thread-level speculation mechanism based on Pthreads(POSIX thread library).The main works are as follows:(1)A TLS thread execution model is proposed.Based on the analysis of the current status of multi-threaded execution models at home and abroad,this thesis proposes a TLS threaded execution model in view of the large amount of rollback overhead caused by the thread-level speculative execution model in conflict detection.According to the different execution stages of sub-threads during speculative execution,this thesis divides them into idle state,speculative state,and submittable state.Based on the mutual conversion relationship between these three states,this article describes the speculative execution flow of the main thread and the subthreads.After completing the logic level design,this thesis uses the Pthreads programming model to design and implement the proposed execution model's speculative initialization process,sub-thread activation,and submission operations,etc.,to provide theoretical support and a platform for the speculative parallel of serial programs stand by.(2)A set of speculative variable management mechanism is designed.Aiming at the problem of speculative operations that depend on variables between programs during multithreaded execution,this thesis assigns a thread-local storage variable to each sub-thread to record the sub-thread's operations on the speculative variable and the speculative value.At the same time,a shared storage variable is set for each speculative variable,which is used for the conflict dependency detection and submission operation of the speculative variable of the multi-threaded version,realizes the read and write operations of the speculative variable by the thread,and ensures the data security of the same speculative variable among multiple threads.After that,this thesis defines a set of speculative variable APIs to simplify the difficulty of thread-level speculative programming and improve the efficiency of speculative parallel programming.In order to verify the parallel performance of the thread-level speculation mechanism based on Pthreads proposed in this article,three benchmark programs are selected for experimental verification and result analysis from four aspects: thread scalability,program input scale,speculative execution time,and method comparison.In the thread scalability experiment,the experimental data shows that this study has good and stable speculative parallel gains as the number of sub-threads increases;the input set comparison experiment shows that as the input data size increases,speculative multi-threading gains Parallel revenue will also increase;by analyzing the speculative execution time of the program,it can be seen that this study can reduce misspeculative execution while gaining parallel revenue;finally,the comparison with AIPM shows that this study can improve the performance of speculative speedup about 5.19%.
Keywords/Search Tags:Speculative multithreading, Parallel computing, Execution model, Multi-cores, Pthreads
PDF Full Text Request
Related items