Re: Overlapped IO (Sockets) and _beginethreadEx
From: Len Holgate (Len.Holgate_at_JetByte.com)
Date: 02/26/04
- Next message: Chew Lek Wah: "rasdial"
- Previous message: Eugene Gershnik: "Re: Need help joining domains"
- In reply to: jt: "Overlapped IO (Sockets) and _beginethreadEx"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 26 Feb 2004 09:23:35 -0000
We found that the best way to deal with this was to have a pool of threads
for the database access and a pool for IO. The IO threads post completed
requests to the database pool and that pool handles the database.
We wrote an article about this design here:
http://www.jetbyte.com/portfolio-showarticle.asp?articleId=38&catId=1&subcatId=2,
the article contains complete source code for a IOCP server framework and
has an example server that uses a seperate thread pool for business logic
(db) work. Updates to the code are available here
http://www.lenholgate.com/archives/000082.html.
The design means that IO threads are always available and database requests
get queued in the IOCP between the two pools. The db pool can grow and
shrink within predetermined limits as demand demands...
-- Len Holgate - http://www.lenholgate.com JetByte Limited - http://www.jetbyte.com The right code, right now. Contract Programming and Consulting Services.
- Next message: Chew Lek Wah: "rasdial"
- Previous message: Eugene Gershnik: "Re: Need help joining domains"
- In reply to: jt: "Overlapped IO (Sockets) and _beginethreadEx"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|