Hi All,

I don't know in which group my question needs to be posted so here i go:

I know that the socket 'begin...' methods uses the threadpool to call the
callback function but does that mean that the sockets can't handle more than
25 concurrent 'begin...' methods that complete since the threadpool only has
25 threads to process the completion?

Thanks for any insight in this.

Greetz,
Richard.

Re: Threadpool and Sockets by Chris

Chris
Sun Sep 24 08:06:35 CDT 2006

Hi,

By default the async sockets run on IO completion threads, these are
addition threads which can be created up to a default limit of 1000. So if
your worker thread pool is depleted (25 per CPU) async socket requests
continue to function. In the 2.0 framework the Socket.UseOnl;yOverlappedIO
would shift this to use the standard thread pool threads.

Hope this helps

--
Chris Taylor
http://dotnetjunkies.com/weblog/chris.taylor
"Richard" <rh@xs4all.nl> wrote in message
news:451653ab$0$4513$e4fe514c@news.xs4all.nl...
> Hi All,
>
> I don't know in which group my question needs to be posted so here i go:
>
> I know that the socket 'begin...' methods uses the threadpool to call the
> callback function but does that mean that the sockets can't handle more
> than 25 concurrent 'begin...' methods that complete since the threadpool
> only has 25 threads to process the completion?
>
> Thanks for any insight in this.
>
> Greetz,
> Richard.
>



Re: Threadpool and Sockets by Chris

Chris
Sun Sep 24 08:28:04 CDT 2006

Rereading my answer, I incorrectly stated that the UseOnlyOverlappedIO uses
the standard thread pool threads, that is incorrect, the IO threads are
still used and do not affect the standard 25 per cpu thread pool threads. It
is just that overlapped IO is used rather than binding a IOCompletion port
to the socket and has nothing to do with the thread management.

Dull moment, Sorry for any confusion.

--
Chris Taylor
http://dotnetjunkies.com/weblog/chris.taylor
"Chris Taylor" <chris_taylor_za@hotmail.com> wrote in message
news:eb3VQs93GHA.1068@TK2MSFTNGP05.phx.gbl...
> Hi,
>
> By default the async sockets run on IO completion threads, these are
> addition threads which can be created up to a default limit of 1000. So if
> your worker thread pool is depleted (25 per CPU) async socket requests
> continue to function. In the 2.0 framework the Socket.UseOnl;yOverlappedIO
> would shift this to use the standard thread pool threads.
>
> Hope this helps
>
> --
> Chris Taylor
> http://dotnetjunkies.com/weblog/chris.taylor
> "Richard" <rh@xs4all.nl> wrote in message
> news:451653ab$0$4513$e4fe514c@news.xs4all.nl...
>> Hi All,
>>
>> I don't know in which group my question needs to be posted so here i go:
>>
>> I know that the socket 'begin...' methods uses the threadpool to call the
>> callback function but does that mean that the sockets can't handle more
>> than 25 concurrent 'begin...' methods that complete since the threadpool
>> only has 25 threads to process the completion?
>>
>> Thanks for any insight in this.
>>
>> Greetz,
>> Richard.
>>
>
>



Re: Threadpool and Sockets by William

William
Sun Sep 24 10:13:22 CDT 2006

Also, it is not expected that many IOs will complete at ~exactly the same
point. Even so, we still should not do much in the callback, maybe just
update some state and kick off another async io (to keep the IOCP TP from
stalling).

--
William Stacey [MVP]

"Chris Taylor" <chris_taylor_za@hotmail.com> wrote in message
news:OluPR493GHA.3840@TK2MSFTNGP06.phx.gbl...
| Rereading my answer, I incorrectly stated that the UseOnlyOverlappedIO
uses
| the standard thread pool threads, that is incorrect, the IO threads are
| still used and do not affect the standard 25 per cpu thread pool threads.
It
| is just that overlapped IO is used rather than binding a IOCompletion port
| to the socket and has nothing to do with the thread management.
|
| Dull moment, Sorry for any confusion.
|
| --
| Chris Taylor
| http://dotnetjunkies.com/weblog/chris.taylor
| "Chris Taylor" <chris_taylor_za@hotmail.com> wrote in message
| news:eb3VQs93GHA.1068@TK2MSFTNGP05.phx.gbl...
| > Hi,
| >
| > By default the async sockets run on IO completion threads, these are
| > addition threads which can be created up to a default limit of 1000. So
if
| > your worker thread pool is depleted (25 per CPU) async socket requests
| > continue to function. In the 2.0 framework the
Socket.UseOnl;yOverlappedIO
| > would shift this to use the standard thread pool threads.
| >
| > Hope this helps
| >
| > --
| > Chris Taylor
| > http://dotnetjunkies.com/weblog/chris.taylor
| > "Richard" <rh@xs4all.nl> wrote in message
| > news:451653ab$0$4513$e4fe514c@news.xs4all.nl...
| >> Hi All,
| >>
| >> I don't know in which group my question needs to be posted so here i
go:
| >>
| >> I know that the socket 'begin...' methods uses the threadpool to call
the
| >> callback function but does that mean that the sockets can't handle more
| >> than 25 concurrent 'begin...' methods that complete since the
threadpool
| >> only has 25 threads to process the completion?
| >>
| >> Thanks for any insight in this.
| >>
| >> Greetz,
| >> Richard.
| >>
| >
| >
|
|



Re: Threadpool and Sockets by Carl

Carl
Sun Sep 24 11:25:33 CDT 2006

"William Stacey [MVP]" <william.stacey@gmail.com> wrote in message
news:ulfa9v%233GHA.3840@TK2MSFTNGP06.phx.gbl...
> Also, it is not expected that many IOs will complete at ~exactly the same
> point. Even so, we still should not do much in the callback, maybe just
> update some state and kick off another async io (to keep the IOCP TP from
> stalling).

Also, see Chris Mullins' blog posting about scalability of .NET socket I/O:

http://www.coversant.net/dotnetnuke/Default.aspx?tabid=88&EntryID=10

-cd



Re: Threadpool and Sockets by Richard

Richard
Mon Sep 25 02:10:24 CDT 2006

Thnx for your time and answers,

Richard.

"Richard" <rh@xs4all.nl> schreef in bericht
news:451653ab$0$4513$e4fe514c@news.xs4all.nl...
> Hi All,
>
> I don't know in which group my question needs to be posted so here i go:
>
> I know that the socket 'begin...' methods uses the threadpool to call the
> callback function but does that mean that the sockets can't handle more
> than 25 concurrent 'begin...' methods that complete since the threadpool
> only has 25 threads to process the completion?
>
> Thanks for any insight in this.
>
> Greetz,
> Richard.
>



Re: Threadpool and Sockets by Chris

Chris
Mon Sep 25 16:08:40 CDT 2006

Damn! You beat me too it! :)

--
Chris Mullins, MCSD.NET, MCPD:Enterprise
http://www.coversant.net/blogs/cmullins


"Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@mvps.org.nospam>
wrote in message news:uUSOQY$3GHA.1608@TK2MSFTNGP04.phx.gbl...
> "William Stacey [MVP]" <william.stacey@gmail.com> wrote in message
> news:ulfa9v%233GHA.3840@TK2MSFTNGP06.phx.gbl...
>> Also, it is not expected that many IOs will complete at ~exactly the same
>> point. Even so, we still should not do much in the callback, maybe just
>> update some state and kick off another async io (to keep the IOCP TP from
>> stalling).
>
> Also, see Chris Mullins' blog posting about scalability of .NET socket
> I/O:
>
> http://www.coversant.net/dotnetnuke/Default.aspx?tabid=88&EntryID=10
>
> -cd
>
>