我上網看了一下
發現他們不同的地方"好像是" 喚起的thread不同
下面是我找到的文章
When you call Control.BeginInvoke,
the call to Control.Invoke is made on a threadpool thread and the call to
BeginInvoke returns immediately. So, in effect, you have a worker thread
calling BeginInvoke. The threadpool thread then takes over and calls
Control.Invoke, waiting on the return value. The delegate passed to Invoke
is then invoked on the UI thread.
If you call Delegate.BeginInvoke, then you go from your worker thread to
the threadpool thread, where the method pointed to by the delegate gets
executed. If you are accessing UI elements on this thread, you are going to
get unpredictable results.
但是我又對worker thread這個東西有點疑問
它不是UI thread,那他是什麼東西
一個windows form程式除了本身的main thread之外,背後還有一個worker thread
然後又冒出一個threadpool,這更讓我想瞭解c#觀念 越來越模糊
想請問一下各位前輩,可以指導小弟觀念上的問題
謝謝各位
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 163.25.101.28
※ 編輯: reptile0426 來自: 163.25.101.28 (11/21 16:40)