Threading: does c# have an equivalent of the Java Runnable interface?

前端 未结 7 1208
礼貌的吻别
礼貌的吻别 2021-01-31 15:44

Does c# have an equivalent of the Java Runnable interface?

If not how could this be implemented or is it simply not needed?

thanks.

7条回答
  •  Happy的楠姐
    2021-01-31 16:14

    Nope. C# handles threads differently to Java. Rather than subclassing the Thread class, you simply create a new System.Threading.Thread object and pass it a ThreadStart delegate (this is the function where you do the work)..

提交回复
热议问题