clr threads
DESCRIPTION
Quick review of the therading options in .NET.TRANSCRIPT
CLR Threads and the Async Programming ModelCLR Threads and the Async Programming ModelFlorin CardaşimLead developerRomSoft, IAŞI, http://www.rms.ro
Florin CardaşimLead developerRomSoft, IAŞI, http://www.rms.ro
AgendaAgenda
• Thread, Thread.IsBackgound, ThreadStart, Exceptions(.NET 1.1 vs 2.0)
• ThreadPool
• Asynchronous Programming Model: BeginInvoke, EndInvoke, AsyncCallback, IAsyncResult
• Thread, Thread.IsBackgound, ThreadStart, Exceptions(.NET 1.1 vs 2.0)
• ThreadPool
• Asynchronous Programming Model: BeginInvoke, EndInvoke, AsyncCallback, IAsyncResult
ConclusionsConclusions
• Use ThreadPool and the APM whenever possible!
• When to use dedicated Thread:• Start with high priority; TP - normal• Foreground; TP - background• Long running operations• Control the thread’s lifetime
(Thread.Abort)
• Always catch and handle the exceptions
• Use ThreadPool and the APM whenever possible!
• When to use dedicated Thread:• Start with high priority; TP - normal• Foreground; TP - background• Long running operations• Control the thread’s lifetime
(Thread.Abort)
• Always catch and handle the exceptions
Q&AQ&A
Thank you!Thank you!
Florin CardaşimLead developerRomSoft, IAŞI, http://www.rms.ro
Florin CardaşimLead developerRomSoft, IAŞI, http://www.rms.ro