Add a CPU affinity set to the TCB if SMP is enable and use this CPU set as a mask for determining which CPUs the thread may run on. Add an affinity field to the attrributes to permit controlling which CPUs a pthread may run on. Implements pthread_att_setaffinity_np() and pthread_attr_getaffinity_np().

This commit is contained in:
Gregory Nutt
2016-02-19 17:33:35 -06:00
parent 2075eb7932
commit a633353ec3
28 changed files with 174 additions and 355 deletions
+4
View File
@@ -178,6 +178,10 @@ struct pthread_attr_s
uint8_t max_repl; /* Maximum pending replenishments */
#endif
#ifdef CONFIG_SMP
cpu_set_t affinity; /* Set of permitted CPUs for the thread */
#endif
size_t stacksize; /* Size of the stack allocated for the pthread */
#ifdef CONFIG_SCHED_SPORADIC