- IOCP - reasons NOT to use it
- Posted by dtdev on January 5th, 2005
hi,
Im wondering if there is any reasons NOT to use IOCP ? (performance,
limitations, etc). compared to eventbased operations (im primarily
considering sockets communcation on XP/2K here).
The reason i ask is that i have a server which is eventbased, its working
fine - but im considering rewriting this to use IOCP, as a learningprocess -
but before i start, i would like to know if any of you have any pro & cons
concering IOCP ?
As far as i understand there is only advantages with IOCP (or at least no or
very few disadvantages with few connections) - only thing is that the server
is started with XXX connections, which ofcourse takes up some memory and
some resources, but besides that i can only see that the scaleability will
be better with IOCP.
Or am i wrong ?
Hope to hear from you guys, thanks.
- Posted by R-BOLA on January 7th, 2005
On Wed, 5 Jan 2005 10:53:39 +0100, "dtdev" <no.spam@spamnotx.it>
wrote:
Scalability with IOCP is really good. You don't have to create XXX
connections all upfront, typically you would create a pool of
connections at the start representing an expected typical loading.
When these connections are "used" they are despatched to your IOCP
when the sockets are accepted.
During the IOCP routine to accept the new connections, you then look
at how many connections you have left outstanding and create some
more. The key is to ensure that there are always some sockets queued
to accept the new connections.
Depending on your solution it might also be a good candidate to chuck
the processing of your network events onto a thread pool using the
QueueUserWorkItem API, thus freeing the IOCP up quicker. This can
have a great performance boost in throughput.
Just my 2c worth.
-R-BOLA-
- 12 REASONS (Computers & Technology) by William Poaster
- MTU sizes and reasons (Routers) by Zach Malmgren
- Virgin Net - Any reasons against? (Internet & Broadband) by Brian
- Four Reasons I Won't Use XP (Computers & Technology) by Necromancer
- Reuse disconnected socket in IOCP (Development Resources) by dover

