在XML查询处理中,目前普遍的算法仍然使用传统的串行处理模式,无法充分利用多核资源的优势.针对此问题,设计了一种基于任务抢占与数据分区的XML多核优化策略(Imp-NBPP),它对XML文档进行数据分区,以达到负载平衡,让各个线程独立处理分区内的数据,减少了线程之间同步与通信带来的开销.同时还探讨了任务抢占在多核查询中的应用.实验表明,对于不同大小的XML文档,基于节点数(NBP),基于文档大小(SBP)与本文所提策略,这三种策略与单核查询相比均能有效的节约查询时间;使用Imp-NBPP策略时,在节约查询时间和负载平衡方面均优于NBP、SBP策略.
In XML query process,most algorithms still use the traditional serial mode,and thus it can't make full use of the advan- tage of multi-core resources.This paper uses data partition for the XML document,in order to achieve toad balancing,each thread process the sub-regional data independently in order to reduce synchronization and communication overhead be- tween them,we also discuss the use of task preemption in multi-core query.According to experiment,our strategy reduces more time and gains better balance on workload than both NBP and SBP.