[Mono-devel-list] Mono on a multipocessor

Alex Chudnovsky alexc at majestic12.co.uk
Thu Apr 21 10:25:28 EDT 2005


Thomas Harning Jr. wrote:

>>Is there a reason for replication of such low thread limits from .NET?
>>It is PITA to change those programmatically
>>on Windows (non-portable), and I wonder how can same be done on Mono?
>>
>>    
>>
>
> The reason, I think, for this is that there shouldn't be too many threads spawned.  
>
That not a good reason insofar as async IO is concerned: the whole idea 
of having async IO is to support lots of
concurrent connections and 25 is nowhere near lots in my book. This 
limit in .NET is a big PITA, particularly because they have
not provided programmatical way to change it (at least in v1.1, can't 
speak for v2.0)

>Now... if you want to spawn more, than you could implement a 
>more dynamic threadpool of sorts or just spawn an entirely new thread w/o ThreadPool.
>  
>
No I can't, because I use async IO and its exact implementation details 
are not under my control: its just fact of live that it uses
threads in .NET. I can't really see any way out since using blocking 
sockets will require me to use threads (and probably run out
of them faster).

>One reason for this is that... you don't really gain too 
>much by having 1000 threads all doing stuff at once... 
>
Generally I would agree with you, but I know for fact that I gain better 
performance using async IO (with sockets),
actual callbacks there don't do lots of work, so a single PC can support 
lots and lots of async sockets: certainly over 100

I found a solution (hack really) to make .NET programmatically change 
maximum limit of threads on Windows,
and on Mono I was under the impression that default limit was much 
higher than that in "official" .NET. How can it be changed?

regards,

Alex



More information about the Mono-devel-list mailing list