Font Size: a A A

Multi-threaded Algorithm Parallel Optimization Based On Multi-core Processors

Posted on:2011-10-26Degree:MasterType:Thesis
Country:ChinaCandidate:X F LiFull Text:PDF
GTID:2178330332458855Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
Nowadays, as the growing popularity of multi-core processors, the development of parallel software technology has become the crux. The multi-core technology can accelerate the development of parallel software technology, and also depend on it. At the present time, most of the software or applications in use were developed in serial ideas, so the development of parallel software technology must overcome much difficulty. We need a fundamental change from the traditional serial programming ideas to parallel ideas. There are various parallel programming models, parallel programming models based on shared memory, models based on message transmitting and models based on distributed memory. The multi-threaded parallel programming is one kind of shared memory parallel programming model.It goes without saying the importance of matrix multiplication algorithm; it is widespread in many scientific computing and engineering applications. So, there is a experiment of matrix multiplication algorithm, implemented by Win32 multi-threaded API, OpenMP and C#. It turns out that each method has its advantages and disadvantages. Using Win32 multi-threaded API, it has a good performance, and the threads can be operated explicitly, but it is harder to implement as to others. Using OpenMP, it is easy to implement, but the performance is worse than that when using Win32 multi-threaded API. Although C# supporting multi-thread programming in language level, it implementation is based on virtual machine, so using C#, its performance is the worst, the performance is between the former two. The experiment result is helpful when doing the choice of different multi-threaded developing methods.Sorting algorithm is commonly used and has a great demand of performance. On the basis of the previous experiments, a new combination method of sorting algorithms was supposed, and an optimization was made to the merge algorithm using multi-thread ideas. The optimized merge sorting algorithm can make two thread work at the same time, one of which work from the maximal value side of the two data sequence and write the bigger value to a new data sequence from the max side, and the other one work from the minimal value side and write the less value to the new data sequence from the minimal side. Both of them work until they write to the midpoint of the new data sequence to keep the balance of each thread's workload. The new algorithm was implemented by Win32 multi-threaded API, which is the most efficient method according to the result of the former experiment. The result of the experiment shows the new algorithm has a much better performance.
Keywords/Search Tags:multi-threaded, multi-core, merge sort algorithm, parallel optimize, sorting algorithm, matrix multiplication
PDF Full Text Request
Related items