lk/include/kernel/thread.h:
thread_set_pinned_cpu
#if WITH_SMP
#define thread_curr_cpu(t) ((t)->curr_cpu)
#define thread_pinned_cpu(t) ((t)->pinned_cpu)
#define thread_set_curr_cpu(t,c) ((t)->curr_cpu = (c))
#define thread_set_pinned_cpu(t, c) ((t)->pinned_cpu = (c))
#else
#define thread_curr_cpu(t) (0)
#define thread_pinned_cpu(t) (-1)
#define thread_set_curr_cpu(t,c) do {} while(0)
#define thread_set_pinned_cpu(t, c) do {} while(0)
#endif
本文介绍了操作系统内核中线程与CPU绑定的相关宏定义,包括获取当前线程所绑定的CPU编号及设置线程绑定到特定CPU的方法。这些宏在多处理器系统中用于优化线程调度。
2178

被折叠的 条评论
为什么被折叠?



