Message-ID: <4BPiLB$w5r@bbs.sdu.edu.cn>
Subject: I/O Model Consideration
Date: Sun, 28 Mar 2004 12:07:23 +0000
From: onek.bbs@bbs.sdu.edu.cn (�式�)
Path: news.cnusenet.org!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-cn.bbs.comp.lang.mbox.zip!archiver1.google.com!news1.google.com!news.glorb.com!news.moat.net!ctu-peer!news.nctu.edu.tw!netnews.csie.nctu.edu.tw!maily.cic.tsinghua.edu.cn!netnews.sdu.edu.cn!SDU
Newsgroups: cn.bbs.comp.lang
Organization: 泉������
X-Filename: Programming/M.1080475643.A
Xref: news.cnusenet.org cn.bbs.comp.lang:18078


By now you might be wondering how to choose the I/O model you should use when 
designing your application. As we've mentioned, each model has its strengths a
nd weaknesses. All of the I/O models do require fairly complex programming com
pared with developing a simple blocking-mode application with many servicing t
hreads. We offer the following suggestions for client and server development.


Client Development
When you are developing a client application that manages one or more sockets,
 we recommend using overlapped I/O or WSAEventSelect over the other I/O models
 for performance reasons. But, if you are developing a Windows-based applicati
on that manages window messages, the WSAAsyncSelect model might be a better ch
oice because WSAAsyncSelect lends itself to the Windows message model, and you
r application is already set up for handling messages.

Server Development
When you are developing a server that processes several sockets at a given tim
e, we recommend using overlapped I/O over the other I/O models for performance
 reasons. However, if you expect your server to service a large number of I/O 
requests at any given time, you should consider using the I/O completion port 
model for even better performance.

--

�� ��源:��泉������ http://bbs.sdu.edu.cn [FROM: 202.194.32.132]