辅助线程和普通线程之间有什么区别? [英] What is the difference between a Worker Thread and a Normal Thread?

查看:105
本文介绍了辅助线程和普通线程之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hallo全部
谁能告诉我

工作线程和普通线程之间有什么区别?

Hallo All
can any body tell me

What is the difference between a Worker Thread and a Normal Thread?

推荐答案

它是部分术语.人们用工人"这个词来表示不属于UI或不与UI交互的线程.处理UI的线程称为"UI"线程.通常,您的主(主)线程将是拥有和管理UI的线程.然后启动一个或多个执行特定任务的工作线程.这些工作线程不会直接修改UI.
It''s partly terminology. People use the word "worker" when they mean a thread that does not own or interact with UI. Threads that do handle UI are called "UI" threads. Usually, your main (primary) thread will be the thread that owns and manages UI. And then you start one or more worker threads that do specific tasks. These worker threads do not modify the UI directly.


想象一下,我继续Nishant的Solition:

这些工作线程不会直接修改UI ...

…但是他们可以使用System.Windows.Forms.ControlSystem.Threading.Dispatcher的方法InvokeBeginInvoke.请参阅我过去的答案,其中有详细解释:
Control.Invoke()与Control.BeginInvoke() [ ^ ],
Treeview Scanner和MD5的问题 [
Imagine I continue the Solition by Nishant:

These worker threads do not modify the UI directly…

…but they can use the methods Invoke or BeginInvoke of System.Windows.Forms.Control or System.Threading.Dispatcher. See my past answer where it is explained in detail:
Control.Invoke() vs. Control.BeginInvoke()[^],
Problem with Treeview Scanner And MD5[^].

—SA


这篇关于辅助线程和普通线程之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆