Forum > Other

12th gen Intel cpu's

<< < (3/3)

Leledumbo:

--- Quote from: marcov on December 07, 2021, 09:53:07 am ---
--- Quote from: Leledumbo on December 07, 2021, 09:30:21 am ---AFAIK, there's no userland API to tell the OS which core the app should run on anyway. So, OS' CPU scheduler is what you can rely on.

--- End quote ---

The term is called "Processor affinity", and it exists both for *nix (sched_setaffinity or so?) and Windows (https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setprocessaffinitymask)

--- End quote ---
Ah, the name isn't very intuitive. But this could work for the API caller itself instead of only for other processes?

marcov:

--- Quote from: Leledumbo on December 07, 2021, 10:01:22 am ---Ah, the name isn't very intuitive. But this could work for the API caller itself instead of only for other processes?

--- End quote ---

Primarily it is used for your own threads. Note that it might be less advantageous nowadays since the scheduling is much more complicated (per clock boost and thermal room, not even to speak of Alder Lake/Golden Cove)

PascalDragon:

--- Quote from: Leledumbo on December 07, 2021, 10:01:22 am ---
--- Quote from: marcov on December 07, 2021, 09:53:07 am ---
--- Quote from: Leledumbo on December 07, 2021, 09:30:21 am ---AFAIK, there's no userland API to tell the OS which core the app should run on anyway. So, OS' CPU scheduler is what you can rely on.

--- End quote ---

The term is called "Processor affinity", and it exists both for *nix (sched_setaffinity or so?) and Windows (https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setprocessaffinitymask)

--- End quote ---
Ah, the name isn't very intuitive. But this could work for the API caller itself instead of only for other processes?

--- End quote ---

On *nix thread IDs are global, so you can provide any thread ID as long as you have the necessary privileges (see here). On Windows SetProcessAffinityMask is for threads inside the specified process (this is used for example by the task manager where you can control the affinity as well). There's also SetThreadAffinityMask and as long as you have a handle to the thread and the necessary privileges you can change the affinity of specific threads inside other processes as well.

Navigation

[0] Message Index

[*] Previous page

Go to full version