mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-23 05:25:56 +00:00
Size thread pools by the CPUs of the process's affinity mask
Eight places sized a pool (pipeline workers, library prebuild, translator prewarm and seeding, the multithreaded ASTC decoder) by GetActiveProcessorCount, every logical processor of the machine. A process limited with start /affinity, Task Manager or a launcher then started a pool for 16 CPUs on 4. plat_cpu_usable counts the affinity mask (all active processors for a process that spans processor groups); plat_cpu_count, the machine's count, stays for the system info. Idea from MMadmer's UsableCpuCount in a fork of the Shadow of the Colossus PC port.
This commit is contained in:
1 parent
adf9c768c3
commit
91c5312932
6 files changed
+24
-9
No files matched your search
@@ -19,7 +19,8 @@ void plat_thread_detach(PlatThread *t); // frees t; the thread runs on
|
||||
// Restricts t (NULL: the calling thread) to the logical processors in mask (bit n = processor n of the first group).
|
||||
// Returns the previous mask, 0 on failure.
|
||||
uint64_t plat_thread_affinity(PlatThread *t, uint64_t mask);
|
||||
uint32_t plat_cpu_count(void); // logical processors
|
||||
uint32_t plat_cpu_count(void); // logical processors of the machine (system info)
|
||||
uint32_t plat_cpu_usable(void); // the ones this process may run on (its affinity mask): size thread pools by it
|
||||
|
||||
// ---- time
|
||||
uint64_t plat_now_ns(void); // monotonic, high resolution, arbitrary epoch
|
||||
|
||||
Reference in new issue
Block a user