为了充分利用多核处理器资源,研究了Intel线程构建模块并行编程模式。基于任务调度器,建立了逻辑线程和物理线程最佳匹配和映射的面向任务编程模式。利用任务调度器,设计了N皇后问题在多核处理器的并行算法。该算法将任务自动地映射到多线程,减少消息传递和数据移动带来的额外开销,提高多核CPU的使用效率。并行算法的加速比接近核数,CPU使用效率超过90%,实验结果表明,该算法有效地提升了多核计算机资源的利用率。
To take full advantage of multi-core processor resources,Intel threading building blocks parallel programming is studied.Based on the task scheduler,the task-oriented programming model to achieve the best matching and mapping between logical thread and physical thread is constructed.N-Queens of multi-core parallel algorithm based on task scheduler is designed.The algorithm automatically mapped to the task of multi-threading.The additional overhead caused by messaging and data movement is reduced.The efficient use of multi-core is improved.Experimental results show that the parallel algorithm speedup close to the number of multi-core,CPU efficiency more than 90% and improve multi-core computer resources utilization effectually.