Suppose I have a 16 core machine and I want a Node.js webserver to use 8 cores, and I want a Java REST/API server to use the other 8. The idea being that Node would be making API calls over localhost, even though the API server may handle requests coming from elsewhere.
I'm using Node's cluster module to accomplish this; basically, doing cluster.fork() 8x. I assume Java has its own ways of utilizing X cores, but others are writing that piece of software.
Is there anything I need to do, from a node perspective, to ensure that my code doesn't run on any of the same cores Java is running on? It seems simple enough to run fork() n/2 times, where n = numCpus, and if that's all I need to worry about, great, but I wanted to ask this question to make sure I'm not missing something important.
fork()will spawn a new process, yes, but there is no feasible way to keep a process on a core without using some sort of virtualization.