can the scheduler decide to schedule an interrupted but runnable thread on another CPU core? What are the implications for code?

Andrey Chernov ache at freebsd.org
Sat Feb 15 01:59:28 UTC 2014


On 15.02.2014 3:59, Andriy Gapon wrote:
>> This is code example from cpuminer port, in case you are interested, it is very simple:
>>
>> static inline void affine_to_cpu(int id, int cpu)
>> {
>>         cpuset_t set;
>>         CPU_ZERO(&set);
>>         CPU_SET(cpu, &set);
>>         cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_CPUSET, -1, sizeof(cpuset_t), &set);
> 
> I think that CPU_WHICH_TID should have been used here.
> 

You are right, thanx!

-- 
http://ache.vniz.net/


More information about the freebsd-arch mailing list