The IO completion ports aren't really part of the .NET thread pool (meaning they aren't actually managed threads) but owned by the underlying OS (though you can see how many are available using the ThreadPool methods).
If you're worried about holding open thread pool threads when doing asynchronous Socket I/O operations, you can stop. If you use Begin/End, all data transfer happens on the "magic IO threads" and only your callback notification letting you know how the operation succeeded or failed (etc) happens on the thread pool thread. Adam.. > -----Original Message----- > From: Unmoderated discussion of advanced .NET topics. > [mailto:[EMAIL PROTECTED] On Behalf Of Tony Hal > Sent: Wednesday, September 21, 2005 7:23 PM > To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM > Subject: Re: [ADVANCED-DOTNET] Async Thread > > Adam, > Thanks for the reply. > For #2, you said that the data is sent using completion port thread. > Is this thread part of the .net thread pool ? or is it custom > implementation ? > (Note: .net thread pool has 2 kinds of threads: worker or > completion port/io). > > > >From: Adam Sills <[EMAIL PROTECTED]> > >Reply-To: "Unmoderated discussion of advanced .NET topics." > ><ADVANCED-DOTNET@DISCUSS.DEVELOP.COM> > >To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM > >Subject: Re: [ADVANCED-DOTNET] Async Thread > >Date: Wed, 21 Sep 2005 18:39:56 -0500 > > > > > 1. In AST.NET, if you implement http async handler, > ASP.NET thread > > > will call the BeginProcessRequest method. How is this > ASP.NET thread > > > implemented ? > > > Is it one of the managed thread pool thread ? (which one ? > > > worker thread or completion port thread ?) Is it > implemented using a > > > custom thread pooling which is different from the .net > thread pool ? > > > >Thread pool thread. > > > > > 2. When you call the async Socket's BeginWrite and pass a > callback, > > > which thread will invoke the callback ? > > > Is it the one of the managed thread pool ? (again, which one > > > ?) Or is it implemented using its own private thread pool ? > > > (in this case, is it based on NT completion port ?) The > main thing > > > is I want to know if the thread is based on NT completion port. > > > Has anyone had any experience using the .net async Socket ? > > > Is the perf close to the unmanaged/native one ? > > > >The data is written on an IO completion port (or read when doing > >BeginRead), your callback is activated on a thread pool thread. =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com