When I create a thread with Java or Python I can't find the pid
among the operating system threads. In fact get_ident()
in Python gives me a very large number that can't be the PID.
In fact I need to set the process affinity of all other threads to the first processor core then I want to dedicate the other cores to my specific threads run in a program to create a real time environment. The threads will be less than remaining processor cores.
As I have read in stackoverflow it is not possible in Java and there will be the esigence of native calls. Can it be done in Python or I must use C/C++?
The program will be installed in a Linux machine.
For java threads, especially under Linux, there is https://github.com/OpenHFT/Java-Thread-Affinity