开发者

Set specific cpu core for task in GNAT

I'm using Gnat and want to set a specific execution core for one of the tasks. The problem is that I couldn't find any docs on that. Despite the addition of System.Multiprocessor, as mentioned her开发者_StackOverflowe and here, the compiler keeps saying that it's not a predefined library unit. This happens even if I add the -gnat12 flag. Any suggestions on how can I use that feature?`


Gnat provides the compiler-specific Task_Info pragma, which associates a Task_Info_Type block of data with a given task. Among the fields of that data block is one used to set processor infinity. The exact definition of the System.Task_Info.Task_Info_Type differs by platform, so you need to review the System.Taskinfo package for the platform on which your executable is running.

(Obviously this is not a portable solution, that is coming with Ada 2012.)

Shameless plug: See the Magpie framework hosted at SourceForge for distributing work amongst multicore CPUs for an example of setting processor affinities.


You will have to wait until your compiler supports the package.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜