Interrupting an assembly instruction while it is operating

Yes all “normal” ISAs including 8080 and x86 guarantee that instructions are atomic with respect to interrupts on the same core. Either an instruction has fully executed and all its architectural effects are visible (in the interrupt handler), or none of them are. Any deviations from this rule are generally carefully documented. For example, Intel’s … Read more

When does Java’s Thread.sleep throw InterruptedException?

You should generally NOT ignore the exception. Take a look at the following paper: Don’t swallow interrupts Sometimes throwing InterruptedException is not an option, such as when a task defined by Runnable calls an interruptible method. In this case, you can’t rethrow InterruptedException, but you also do not want to do nothing. When a blocking … Read more