开发者

Does any one know how to use IOCompletionPortTaskScheduler and IOTaskScheduler in ParallelExtensionExtras and what are their use?

Does any one know how to use the following classes in ParallelExtensionExtras and what they are used for?

IOCompletionPortTaskScheduler.cs
IOTaskSchedule开发者_如何学Cr.cs


IOTaskScheduler

While we often refer to “the” .NET thread pool, the ThreadPool abstraction in .NET is actually built on top of two pools, one referred to as the worker pool and one referred to as the I/O pool. The former is what’s targeted by the QueueUserWorkItem method as well as by the default TaskScheduler, while the latter is targeted by the UnsafeQueueNativeOverlapped method, and is frequently used for work in Windows Communication Foundation and Windows Workflow Foundation. The IOTaskScheduler scheduler in the IOTaskScheduler.cs file runs tasks on this I/O thread pool via the UnsafeQueueNativeOverlapped method.

From here: ParallelExtensionsExtras Tour – #7 – Additional TaskSchedulers


The IOCompletionPortTaskScheduler class offers a task scheduler that uses an I/O completion port in order to control concurrency. It is necessary to set the maximum number of threads in the scheduler to be executing concurrently and the number of threads to have available in the scheduler for executing tasks.

From here: http://www.drdobbs.com/parallel/specialized-task-schedulers-in-net-4-par/228800428

And the following from: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365198%28v=vs.85%29.aspx

I/O completion ports provide an efficient threading model for processing multiple asynchronous I/O requests on a multiprocessor system. When a process creates an I/O completion port, the system creates an associated queue object for requests whose sole purpose is to service these requests. Processes that handle many concurrent asynchronous I/O requests can do so more quickly and efficiently by using I/O completion ports in conjunction with a pre-allocated thread pool than by creating threads at the time they receive an I/O request.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜