什么是工作线程和I / O线程之间的区别? [英] What's the difference between a worker thread and an I/O thread?

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

问题描述

在在Web.config processModel元素看有两个属性。

Looking at the processmodel element in the Web.Config there are two attributes.

maxWorkerThreads="25" 
maxIoThreads="25"

什么是工作线程和I / O线程之间的区别?

What is the difference between worker threads and I/O threads?

推荐答案

从根本上说并不是很多,它是所有关于ASP.NET和IIS如何分配I / O等待的对象和管理通信的网络和传输的争夺和延迟数据。

Fundamentally not a lot, it's all about how ASP.NET and IIS allocate I/O wait objects and manage the contention and latency of communicating over the network and transferring data.

I / O线程抛开这样,因为他们会做I / O(顾名思义),可能要等待一段时间长周期(数百毫秒)。它们也可以被优化,并使用不同的,以利用I / O完成端口功能在Windows内核。一个I / O线程可管理多个完成端口来维持产量。

I/O threads are set aside as such because they will be doing I/O (as the name implies) and may have to wait for "long" periods of time (hundreds of milliseconds). They also can be optimized and used differently to take advantage of I/O completion port functionality in the Windows kernel. A single I/O thread may be managing multiple completion ports to maintain throughput.

Windows有与我打交道/ O阻塞而ASP.NET/.NET有螺纹的纯概念的很多功能。 ASP.NET可以通过使用更多的在操作系统的非托管线程功能优化I / O。你不希望为每个线程,你失去了很多的功能,.NET给你这就是为什么有之间的线程是如何打算用来区分做这一切的时候。

Windows has a lot of capabilities for dealing with I/O blocking whereas ASP.NET/.NET has a plain concept of "Thread". ASP.NET can optimize for I/O by using more of the unmanaged threading capabilities in the OS. You wouldn't want to do this all the time for every thread as you lose a lot of capabilities that .NET gives you which is why there is a distinction between how the threads are intended to be used.

工作线程的线程在其经常工作或只是简单的code /处理情况。工作线程不太可能阻止了很多或等待什么,将是短期运行的,因此需要更积极调度,以最大限度地提高处理能力和吞吐量。

Worker threads are threads upon which regular "work" or just plain code/processing happens. Worker threads are unlikely to block a lot or wait on anything and will be short running and therefore require more aggressive scheduling to maximize processing power and throughput.

:我也发现了这个链接,是对这个问题尤其重要:
<一href=\"http://blogs.msdn.com/ericeil/archive/2008/06/20/windows-i-o-threads-vs-managed-i-o-threads.aspx\">http://blogs.msdn.com/ericeil/archive/2008/06/20/windows-i-o-threads-vs-managed-i-o-threads.aspx

: I also found this link which is particularly relevant to this question: http://blogs.msdn.com/ericeil/archive/2008/06/20/windows-i-o-threads-vs-managed-i-o-threads.aspx

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

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