How to control which core a process runs on?

As others have mentioned, processor affinity is Operating System specific. If you want to do this outside the confines of the operating system, you’re in for a lot of fun, and by that I mean pain. That said, others have mentioned SetProcessAffinityMask for Win32. Nobody has mentioned the Linux kernel way to set processor affinity, … Read more

Determine target ISA extensions of binary file in Linux (library or executable)

The unix.linux file command is great for this. It can generally detect the target architecture and operating system for a given binary (and has been maintained on and off since 1973. wow!) Of course, if you’re not running under unix/linux – you’re a bit stuck. I’m currently trying to find a java based port that … Read more

How to check if a CPU supports the SSE3 instruction set?

I’ve created a GitHub repro that will detect CPU and OS support for all the major x86 ISA extensions: https://github.com/Mysticial/FeatureDetector Here’s a shorter version: First you need to access the CPUID instruction: #ifdef _WIN32 // Windows #define cpuid(info, x) __cpuidex(info, x, 0) #else // GCC Intrinsics #include <cpuid.h> void cpuid(int info[4], int InfoType){ __cpuid_count(InfoType, 0, … Read more