Anything related to processor affinity, also known as CPU pinning. The processor affinity is a propriety of a process or a thread in an OS on multi-processor or multi-core systems that influences the OS' scheduling algorithm, binding the execution of that process (or thread) to a specific processor (or core). DO NOT use this tag as a synonym for [affinetransform] tag.
Questions tagged [affinity]
330 questions
0
votes
2 answers
Windows Affinity
When setting the Windows CPU affinity mask for Core 2, is the mask supposed to be 0x0010 or 0x0001? I have seen an example where the mask was set to 0x0010 for Core 0 but this didn't make much sense?

user3811839
- 141
- 7
0
votes
0 answers
Non-repeatable affinity for pthreads
I am trying to measure the time it takes for a thread from creation to actually start.
Using POSIX thread on a Debian 6.0 machine with 32-cores (no hyper-threading) and calling pthread_attr_setaffinity_np function to set the affinity.
In a loop, I…

Rakib
- 791
- 8
- 19
0
votes
1 answer
affinity.get_process_affinity_mask(pid) returns ValueError 22
I want to put my thread workers on a certain CPU(i want to test how GIL impacts on my program...), and i find a third-party library called affinity.
I used pip install affinity to make it available in my VM(Linux), unfortunately, i got the error…

3quanfeng
- 39
- 1
- 9
0
votes
1 answer
Regarding the process swap IN core number in multi core system
Is there any way I can find how many processes swapped into particular core in a given period of time on multi core system ?
Say suppose, I have 8 core machine in which one process is hard affined to core 3 and would like to know how many times…

Snake
- 63
- 1
- 9
0
votes
1 answer
Powershell 4 - Setting processor affinity for runspaces and multiple threads
I'd like to set the cpu-affinity of multiple particular threads.
All the references I've found so far deal with setting the cpu-affinity of a process(PID) but not a thread. Is there a way to accomplish this while using .Net Runspaces? Or am I trying…

Jeremy
- 243
- 2
- 10
0
votes
2 answers
Preventing Windows from changing process affinity
I have a multithreaded code that I want to run on all 4 cores that my processor has. I.e. I create four threads, and I want each of them to run on a separate core.
What happens is that it starts running on four cores, but occasionally would switch…

Peter Kravchuk
- 101
- 1
0
votes
1 answer
How do you set a default processor affinity for all programs?
My computer is using windows 7 and has 8 processors. Some of the programs I run do not take up much processing space, but they lag when I use a processor intensive program (like heavily modded Minecraft). These processes I do not want lagging and…

Adam Geisweit
- 31
- 4
0
votes
1 answer
Not able to set processor affinity
I'm trying to implement this code on a 8 core cluster. It has 2 sockets each with 4 cores. I am trying to create 8 threads and set affinity using pthread_attr_setaffinity_np function. But when I look at my performance in VTunes , it shows me that…

quantumshiv
- 97
- 10
0
votes
1 answer
python Kill all subprocess even parent has exited
I am trying to implement a job queuing system like torque PBS on a cluster.
One requirement would be to kill all the subprocesses even after the parent has exited. This is important because if someone's job doesn't wait its subprocesses to end,…

skipper
- 245
- 5
- 15
0
votes
1 answer
Find out the defualt pthread affinity policy followed by a Linux Kernel 2.6.32
I am trying to find out what is the default affinity policy followed by a Scientific Linux Kernel 2.6.32 when creating pthreads in a HT system. Is there a way of knowing it? In the pthreads creation there are no calls to affinity, so I guess the…

Manolete
- 3,431
- 7
- 54
- 92
0
votes
0 answers
sched_setaffinity nonzero return compiled in 64 bit, zero return in 32 bit
I am running RHEL 6.4 64 bit, and I was given a program to compile and execute. The program has:
cpu_set_t cputset;
CPU_ZERO(&cpuset);
CPU_SET(data->num, &cpuset); //data is a structure, don't think it's relevant to my question
int ret =…

user3000724
- 651
- 3
- 11
- 22
0
votes
1 answer
Java processes vs. threads for thread affinity
I recently wrote some code[1][2] that tried using JNA to make calls to sched_setaffinity in an attempt to set the affinity of the process to a particular core. The first argument of the function sched_setaffinity is the process id.
Calling the…
user277465
0
votes
0 answers
c++ multithreading and affinity
I'm writing a simple thread pool for my application, which I test on dual-core processor. Usually it works good, but i noticed that when other processes are using more than 50% of processor, my application almost halts. This made me curious, so i…

Zwierzolak
- 1
- 1
0
votes
1 answer
Bound all OS processes to one CPU
Is there a way to limit usage of physical CPU for linux-like OS?
I do not want to limit CPU number in general I just want to bound all system processes to one CPU and run other soft on others.

jurka
- 12,945
- 3
- 22
- 20
0
votes
1 answer
linux : Setting process core affinity in assembly language(NASM)
I have question I was wondering if I could set processor core affinity of a linux process using assembly program. I am using nasm for assembling. There is an interrupt for creating a process but i dont how to set core affinity.
Thanx in advance.

raghu777
- 319
- 2
- 11