Re: how many threads? network programming design .NET

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: David Levine (noSpamdlevineNNTP2_at_wi.rr.com)
Date: 08/21/04


Date: Sat, 21 Aug 2004 04:12:30 -0500

You are probably running out of virtual address space. .NET maps each thread
to an underlying operating system thread, and allocates 1M of virtual
address space for each one. By default each app gets a max of 2G of virtual
address space from the operating system, so you are probably bumping into
this limit.

As others have mentioned, no one writes code that uses so many threads, most
of which are blocked waiting on other operations to complete. Use a
threadpool, either the .NET pool (recommended) or roll your own.

"Parahat Melayev" <parahat@momenttech.com> wrote in message
news:%23VGU17dhEHA.1888@TK2MSFTNGP10.phx.gbl...
> Hi
>
> I am programming a multi-threaded asyncronous server with .NET
>
> But when systems thread count reaches to 1350 system can't respond.
>
> Simply my design is creating a Reading Thread after every Accept.
> And creating a Writing Thread when server sends data.
>
> Can you share your experience with me on Network Programming and
> Multi-Threading.
>
>



Relevant Pages

  • Re: how many threads? network programming design .NET
    ... doing it some without the slightest clue of what is going. ... > address space from the operating system, so you are probably bumping into ... >> I am programming a multi-threaded asyncronous server with .NET ...
    (microsoft.public.dotnet.framework)
  • Re: how many threads? network programming design .NET
    ... doing it some without the slightest clue of what is going. ... > address space from the operating system, so you are probably bumping into ... >> I am programming a multi-threaded asyncronous server with .NET ...
    (microsoft.public.dotnet.general)
  • Re: how many threads? network programming design .NET
    ... to an underlying operating system thread, and allocates 1M of virtual ... address space from the operating system, so you are probably bumping into ... > I am programming a multi-threaded asyncronous server with .NET ...
    (microsoft.public.dotnet.general)
  • Re: Python memory handling
    ... this unused memory gets into the page file then the Operating System ... You have a long-running python process that allocates 550Mb of _small_ ...
    (comp.lang.python)