I'm reading Stallings' "Operating Systems Internals and Design Principles", and in the chapter about concurrency and mutual exclusion it reads:
In a uniprocessor system, concurrent processes cannot have overlapped execution; they can only be interleaved. Furthermore, a process will continue to run until it invokes an OS service or until it is interrupted.Therefore, to guarantee mutual exclusion, it is sufficient to prevent a process from being interrupted. This capability can be provided in the form of primitives defined by the OS kernel for disabling and enabling interrupts.
I've found this post in SO that seems to address this question, but the OP doesn't give specifics about the type of interrupt he wants to stop, and the post is dead without ever getting an accepted answer (besides the OP deleted the profile), so I was hoping to get to the bottom of this here. Assuming that I want the CPU fully dedicated to my code (this is only in theory, I know this is very dangereous), how would I be able to achieve this with Java?