Worker threads versus UI threads

简介:

 It’s helpful to think of a rich client application as having two distinct categories of threads: UI threads and worker threads. UI threads instantiate (and subsequently “own”) UI elements; worker threads do not. Worker threads typically execute long-running tasks such as fetching data.

Most rich client applications have a single UI thread (which is also the main application thread) and periodically spawn worker threads—either directly or using BackgroundWorker. These workers then marshal back to the main UI thread in order to update controls or report on progress.

So, when would an application have multiple UI threads? The main scenario is when you have an application with multiple top-level windows, often called a Single Document Interface (SDI) application, such as Microsoft Word. Each SDI window typically shows itself as a separate “application” on the taskbar and is mostly isolated, functionally, from other SDI windows. By giving each such window its own UI thread, the application can be made more responsive.

















本文转自cnn23711151CTO博客,原文链接:http://blog.51cto.com/cnn237111/516381,如需转载请自行联系原作者














相关文章
|
2月前
|
并行计算 JavaScript 前端开发
worker_threads 多线程
worker_threads 多线程
69 4
|
自然语言处理 应用服务中间件 nginx
五分钟进步系列之worker_connections
五分钟进步系列之worker_connections
如何在 go 中实现一个 worker-pool?
如何在 go 中实现一个 worker-pool?
145 0
如何在 go 中实现一个 worker-pool?
|
关系型数据库 MySQL
MySQL里Wating for Slave workers to free pending events到底在等什么
MySQL里Wating for Slave workers to free pending events到底在等什么
208 0
|
内存技术
Vite:Error: Cannot find module ‘worker_threads‘
Vite:Error: Cannot find module ‘worker_threads‘
722 0
Jmeter系列(11)- 并发线程组Concurrency Thread Group详解
Jmeter系列(11)- 并发线程组Concurrency Thread Group详解
710 0
Jmeter系列(11)- 并发线程组Concurrency Thread Group详解
|
存储 JavaScript 前端开发
nodejs中使用worker_threads来创建新的线程
nodejs中使用worker_threads来创建新的线程
|
.NET Windows 开发框架