开发者

What is "Dispatching Threads"

开发者 https://www.devze.com 2023-01-29 18:24 出处:网络
Well, I am not an native speaker so sometimes I am having difficulties when I rea开发者_开发知识库d something about programming and this time is something like that :

Well, I am not an native speaker so sometimes I am having difficulties when I rea开发者_开发知识库d something about programming and this time is something like that :

I am consistently seeing "... dispatching threads" and I am wondering whether it means "running a thread" or "stopping or quitting thread" in Android documents.

And also what does it mean generally in programming.

Thanks.


I believe you are referring to the "Event Dispatch Thread" or EDT.

From http://developerlife.com/tutorials/?p=1263:

All UI operations are performed in a single thread in the native Linux process. This is pretty much the way all graphics on desktop and mobile platforms are performed. This single thread of execution is called the EDT, and it is spawned by the OS when you have a graphical app (as opposed to a command line app or an entirely non visual one). All UI operations, paints, updates, etc. are done on this thread, and it is important to keep long running, high latency tasks off of this thread of execution


Dispatching means to start a thread. Think of it like an emergency operator dispatches emergency personnel to the scene of an accident, i.e., he/she tells them where to go and starts them on their way.


I understand it as: "The thread that makes the task run".


I can see how that would be slightly confusing terminology.

In this case, the meaning of dispatch is "the act of sending off something" - you dispatch a thread to carry out a task, like you would dispatch a messenger to carry a package.

0

精彩评论

暂无评论...
验证码 换一张
取 消