c#中invoke和beginvoke的区别
生活随笔
收集整理的這篇文章主要介紹了
c#中invoke和beginvoke的区别
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
thread th=new thread(()=>{
control.invoke(new Action(()=>{
thread.sleep(5000);
}));
//dosometings
});
th.start();
這個線程里的dosometings將在5000毫秒后執行,invoke是在異步線程阻塞的,可以阻塞另一個線程,而begininvoke則相反是非阻塞異步執行
總結
以上是生活随笔為你收集整理的c#中invoke和beginvoke的区别的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C++项目库包含,dll引用问题,直接把
- 下一篇: 解决 Idea 卡在 Resolving