Linux APIs: Difference between revisions
| Line 14: | Line 14: | ||
== Processes == | == Processes == | ||
==Execution resources== | ==Execution resources== | ||
General details of cpu partitioning and affinity can be found on the [[ | General details of cpu partitioning and affinity can be found on the [[cpuset]] page. | ||
* <tt>getcpu(2)</tt> was added in 2.6.19. It identifies the current CPU and NUMA node of the thread (this might be immediately invalidated). Only one CPU and NUMA id can be reported, which might not make sense for all process models (especially the NUMA part). <tt>sched_getcpu(2)</tt> is equivalent to calling <tt>getcpu(&aid,NULL,NULL)</tt>. | * <tt>getcpu(2)</tt> was added in 2.6.19. It identifies the current CPU and NUMA node of the thread (this might be immediately invalidated). Only one CPU and NUMA id can be reported, which might not make sense for all process models (especially the NUMA part). <tt>sched_getcpu(2)</tt> is equivalent to calling <tt>getcpu(&aid,NULL,NULL)</tt>. | ||
* Since 2.5.8, <tt>sched_getaffinity(2)</tt> and <tt>sched_setaffinity(2)</tt> have provided affinity mask management within the process's cpuset. | * Since 2.5.8, <tt>sched_getaffinity(2)</tt> and <tt>sched_setaffinity(2)</tt> have provided affinity mask management within the process's cpuset. | ||