By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,224 Members | 1,414 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,224 IT Pros & Developers. It's quick & easy.

Threadpool and Sockets

P: n/a
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.
Sep 24 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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.nlwrote in message
news:45**********************@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.

Sep 24 '06 #2

P: n/a
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" <ch*************@hotmail.comwrote in message
news:eb**************@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.nlwrote in message
news:45**********************@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.


Sep 24 '06 #3

P: n/a
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" <ch*************@hotmail.comwrote in message
news:Ol**************@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" <ch*************@hotmail.comwrote in message
| news:eb**************@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.nlwrote in message
| news:45**********************@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.
| >>
| >
| >
|
|
Sep 24 '06 #4

P: n/a
"William Stacey [MVP]" <wi************@gmail.comwrote in message
news:ul****************@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/...=88&EntryID=10

-cd
Sep 24 '06 #5

P: n/a
Thnx for your time and answers,

Richard.

"Richard" <rh@xs4all.nlschreef in bericht
news:45**********************@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.

Sep 25 '06 #6

P: n/a
Damn! You beat me too it! :)

--
Chris Mullins, MCSD.NET, MCPD:Enterprise
http://www.coversant.net/blogs/cmullins
"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:uU**************@TK2MSFTNGP04.phx.gbl...
"William Stacey [MVP]" <wi************@gmail.comwrote in message
news:ul****************@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/...=88&EntryID=10

-cd


Sep 25 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.