Re: multithreaded tcp/ip server large page file
- From: cj <cj@xxxxxxxxxxxxx>
- Date: Wed, 06 Jun 2007 09:20:18 -0400
Thank you for your response. It's always been my belief that everyone is free to have their own opinions on what is a good or bad way to write a program and I respect your opinion, however from where I stand this is indeed an entirely appropriate way to complete the task at hand.
The 1 meg of fully committed virtual memory the threads use should not be kept after the threads end according to what I've seen/read. And if I'm right then letting each thread have a meg is no problem.
Chris Mullins [MVP] wrote:
How weird. I wrote up a full reply, and I see it on Google, but not here:.
http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_thread/thread/f81c1c2591938e5/5c9c7a2df42f27a6
Anyway, the original reply was:
Well, handling a request with a new thread is a pretty bad way to ago.
Each time you spin up a new thread, it's going to take up at least 1 meg of
fully committed virtual memory. You can read all the gory details about this
at:
http://www.bluebytesoftware.com/blog/PermaLink,guid,733d7537-f982-488...
You really, really need to use a different model is you want your
application to scale in any meaningful way. Async I/O is really your only
long term solution.
Typically, you don't need to shutdown threads - they just go away when their
top level method exits. If you poke at your application, use a Performance
Counter to tell how many threads you've got running. If the number is very
high, then something is keeping the threads heald open. Do NOT (don't!
really!) just call "Kill Thread" on the open threads if this is the case -
figure out what the problem is and fix it.
You don't need to worry about the Apartment state stuff - it's not relevant
for a socket app.
- References:
- multithreaded tcp/ip server large page file
- From: cj
- RE: multithreaded tcp/ip server large page file
- From: Charles Wang[MSFT]
- Re: multithreaded tcp/ip server large page file
- From: cj
- Re: multithreaded tcp/ip server large page file
- From: Chris Mullins [MVP]
- multithreaded tcp/ip server large page file
- Prev by Date: Re: SafeArrayTypeMismatchException - .NET GURUS PLEASE HELP
- Next by Date: Re: Impersonation Question
- Previous by thread: Re: multithreaded tcp/ip server large page file
- Next by thread: Re: multithreaded tcp/ip server large page file
- Index(es):
Relevant Pages
|