views:

232

answers:

2

I have a .NET WCF service that will need to handle multiple client requests at once.

The service makes database calls (both read and write) for each client request.

Could IO completion ports be useful for the database access portions of this code to improve concurrent performance? How would they be used in such a situation?

A: 

That depends on how you are doing the database reads and writes. If you're using some sort of direct socket or file input/output calls then you can increase the number of calls you can service concurrently. However, the time to actually do database reads/writes is dependent on the server.

But it is very likely that you're accessing the database through ODBC/OLEDB/ADO/ADO.NET, in which case those libraries do not use IO completion ports. And you can't make them use IO completion ports.

IO completion ports are used to prevent your thread from blocking when it is waiting for IO to complete. Think of it like asynchronous reads/writes.

Tommy Hui
A: 

ADO.NET 2.0 supports async command execution which internally use IO completion ports. (BeginXXX & EndXXX methods)

Check out http://msdn.microsoft.com/en-us/library/ms379553%28VS.80%29.aspx

Nelson P. Varghese