title: Java: Ensure that a thread never gets context switched
body: <p>Among around 150 threads on say 20 core machine. I want that a particular thread never gets context switched. I am not sure that setting Thread priority to MAX_PRIORITY will do this or not? Also if we set priority to max is it necessary that OS will follow the instruction(assuming I run in sudo mode)? </p>