How does Thread.Abort() work?

前端 未结 5 651
鱼传尺愫
鱼传尺愫 2020-12-08 16:41

We usually throw exception when invalid input is passed to a method or when a object is about to enter invalid state. Let\'s consider the following example

         


        
5条回答
  •  臣服心动
    2020-12-08 17:05

    It's easy, the underlying OS does it. If the thread is in any state except 'running on another core', there is no problem - it's state is set to 'never run again'. If the thread is runing on another core, the OS hardware-interrupts the other core via. it's interprocessor driver and so exterminates the thread.

    Any mention of 'time-slice', 'quantum' etc. is just.....

提交回复
热议问题