How to handle interrupts in a thread?
Generally it is up to the programmer what to do when some body interrupts you, but it is quite common to terminate the thread when somebody interrupts you.
if some one interrupts your thread, it is mandatory to go to sleep mode so that the thread which is interrupting will get some CPU time.
if some one interrupts your thread, then you don't need to worry, you just continue what you are doing now.
none of the above
It is a standard to return from run method, if other threads interrupts you. Interrupt basic meaning says stop what you are doing. But it is up to the programmer to decide what to do if other threads interrupts your thread based on your project requirement.
Back To Top