first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

Flippant Remarks about Delegates in C# 2.0

Jeffrey Richter in “Working with Delegates Made Easier with C# 2.0” makes it plain: “Unfortunately, delegates are difficult for many developers to understand and use because delegates require special coordination between your programming language compiler and the CLR.” This “syntactic sugar” discussion is in this document:

http://www.codeguru.com/Csharp/Csharp/cs_delegates/article.php/c4767

This article introduces the ThreadPool.QueueUserWorkItem() Method, documented here:

http://msdn2.microsoft.com/en-us/library/
    system.threading.threadpool.queueuserworkitem.aspx

With the above digested it may then be possible to understand the author motives behind “How to: Declare, Instantiate, and Use a Delegate (C# Programming Guide)” here:

http://msdn2.microsoft.com/en-us/library/ms173176(VS.80).aspx

However, the first question posed in Steven Toub’s June 2006 article “Parameterized ThreadStart, EventWaitHandle, and More” explicitly uses the term “delegate inference,” which helps to make the aforementioned article just a little bit more summarizing and contextually coherent. The Steven Toub article is here:

http://msdn.microsoft.com/msdnmag/issues/06/06/NETMatters/

None of the above discuss the ThreadStart Delegate, documented here:

http://msdn2.microsoft.com/en-us/library/
    system.threading.threadstart.aspx

The ThreadStart Delegate is ‘old’ and may not be in favor because of performance/scalability issues related to a “dedicated thread.” According to Gary J. Kuehn in “Threading paradigms available under the .NET CLR, using C#” he maintains that, “Empirical Analysis of thread CPU usage reveals that operations under the thread pool are more efficient. Processor utilization never reaches 100% while under thread pool control.” This article, as of this writing, is here:

http://www.codeproject.com/cs/threads/managedthreadcs-projects.asp
mod date: 2007-10-01T22:32:13.000Z