这点对于通知外部事件的工作者线程来说很有用。
This is useful for notifying worker threads of external events.
线程分为辅助线程(工作者线程)和用户界面线程。
Threads are divided into Worker Thread and User Interface Thread.
每个工作者线程使用taskhandler类执行一部分工作。
Each worker thread performs some bit of work using the TaskHandler class.
“工作者线程池”,通过在后台执行费时的操作使应用程序响应更加迅速。
A worker thread pool, to make web applications more responsive by performing expensive operations in the background.
通常情况下,我们会在应用程序中创建一定数量的工作者线程来处理这些通知。
Typically an application will also create a number of worker threads to process these notifications.
你可以通过改变程序中的一个文字工作者线程和工作进程之间的切换。
You can switch between worker threads and worker processes by changing a single word in your program.
记住定时回调功能是在一个工作者线程上执行的,所以你必须确保访问state对象的线程安全。
Keep in mind that the timer callback function is executed on a worker thread, so you'll want to ensure that you have thread-safe access to the state object.
此版本的好处是,它是多线程和工作者线程会自动管理,充分强调你的CPU的所有核心。
The benefit of this version is that it is multi-threaded and will automatically manage worker threads to fully stress all cores of your CPU.
这是因为在这5秒期间第一个定时器事件正在睡眠,而定时器却在不同的工作者线程上继续产生时间消失事件。
This is because during the five seconds that the first timer event was sleeping, the timer kept on generating Elapsed events on different worker threads.
的螺纹和福克斯模块提供相同的接口。你可以通过改变程序中的一个文字工作者线程和工作进程之间的切换。测试吧。
The threads and forks module provide the same interface. You can switch between worker threads and worker processes by changing a single word in your program. Test it yourself.
因为TimerCallback功能也是在工作者线程上被调用,没有一个跳动被跳过(假设有工作者线程可用)。
Because the TimerCallback function gets called on a worker thread, there are no skipped beats (assuming the availability of worker threads).
序列迭代:多次调用Fibonacci序列代码,从而与上面的SPE和Pthread测试中执行的工作者线程匹配。
Sequential iteration: the Fibonacci sequence code is called iteratively multiple times to match the number of workers that were executed in the SPE and Pthread tests above.
为了区别工作者线程和UI线程,在例子程序的主入口点设置CurrentThread对象的名字属性为“UIThread ”。
In order to distinguish worker threads from the UI thread, the main entry point for the sample application sets the Name property of the CurrentThread object to "UIThread."
我首先使用Pthread代码进行完整的测试,以此了解PPE对称多线程给Fibonacci工作者线程提供的加速效果。
I first completed testing using the Pthreaded code just to take a look at the speedup provided by the PPE symmetric multithreading to the Fibonacci worker threads.
最大的区别就在与System.Timers.Timer类是对Win32可等待定时对象的一个包装,并在工作者线程上产生一个时间片消失事件而不是在UI线程上产生一个时间标记事件。
The biggest difference is that System.Timers.Timer is a wrapper around Win32 waitable timer objects and raises an Elapsed event on a worker thread rather than a Tick event on the UI thread.
这种模式能被很多行业运用,从出版到在线程序到信息工作者等等(甚至博客)!
This model can be applied to many businesses, from publishing to online apps to information workers and more ( even blogging!).
这种模式能被很多行业运用,从出版到在线程序到信息工作者等等(甚至博客)!
This model can be applied to many businesses, from publishing to online apps to information workers and more ( even blogging!).
应用推荐