CLR

.NET thread-pool threads and CLR worker threads

I will try to answer following questions in this article:How many threads are available in .NET thread pool?How long does the CLR take to create a new Non-thread-pool thread?How long does the CLR take to schedule a task on a thread-pool thread?How long does the CLR take to create a new thread-pool thread when it does not have enough thread available in the pool? How many threads are available in .NET thread pool? Code: Output: The min number of workerThreads is 8. It is the number of threads available ......

Posted On Thursday, August 4, 2016 3:33 PM | Comments (53)

Events and Resouce Leak

Had this question when I was reading “Effective C#: 50 Specific Ways to Improve Your C#”. In the item 18: "Implement the Standard Dispose Pattern", the book recommends to implements IDisposable.Dispose() to do following tasks: 1. Freeing all unmanaged resources. 2. Freeing all managed resource (this includes unhooking events). 3. … My question is on point 2, why do we have to unhook events? After having a look of how System.Delegate is implemented, I found the reason is actually quite simple. To ......

Posted On Tuesday, February 20, 2007 4:08 PM | Comments (1)

Copyright © Changhong Fu

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski