Mastering .NET Threading

  • duration 16 hours
  • Language English
  • format Online
duration
16 hours
location
Online
Language
English
Code
PTRN-004
price
€ ... *

Available sessions

To be determined



Training for 7-8 or more people?
Customize trainings for your specific needs


Roadmap

Thread Basics
This section introduces the concept of a thread, why the concept was introduced into Windows, the benefits of threads, the overhead of threads, and other thread properties.
  • What is a thread and its overhead
  • Tools to examine thread usage
  • How to create and start a thread
  • How to effectively use threads in your own applications and components
  • What is the right number of threads an app should have?
  • Thread scheduling and priorities
Performing Compute-Bound Asynchronous Operations
This section explains how to identify compute-bound operations and how to leverage multiple CPUs so that your operation scales thereby improving your application’s performance.
  • The CLR’s thread pool, how it works, and why you should use it
  • How to queue asynchronous operations to the thread pool
  • NET’s standard cooperative cancellation pattern
  • Using the Task API and leveraging its new features, such as
    • Determining the result of an asynchronous operation
    • Supporting the cancelation pattern
    • Starting tasks after another task completes
    • Associating child tasks with a parent task
    • How to queue tasks to the GUI thread
    • Expression complex operation dependencies with tasks
  • How to parallelize simple for and foreach loops
  • Using timers to execute tasks periodically
Performing I/O-Bound Asynchronous Operations
This section explains how to identify I/O-bound operations and how to execute the operations asynchronously thereby reducing the resources required by an application while increasing performance.
  • How Windows performs synchronous and asynchronous I/O operations
  • Using .NET’s Asynchronous Programming Model for Streams, sockets, database requests, web service requests, and more
  • How to properly architect scalable server applications Examples: ASP.NET Web Forms, Web Services, HTTP handlers, WCF Services, etc.
  • Special considerations required for GUI and ASP.NET applications (using SynchronizationContext to connect an application model to its threading model)
Primitive Thread Synchronization Constructs
This section shows the mechanisms offered by the computer’s CPUs to coordinate activities by multiple threads.
We then discuss how these primitive mechanisms are built upon to provide the primitives offered by Windows and exposed by the .NET Framework to application and component developers. This section also defines terms, such as starvation, spinning, blocking, deadlock, livelock, lazy creation, thread ownership, recursion, etc., that are  used to distinguish locks from one another.
  • The thread synchronization mindset
  • Class libraries and thread safety
  • Primitive User-Model Constructs
    • The CLR’s memory model: Volatile field access
    • Interlocked operations
    • Spin locks
  • Primitive Kernel Object Constructs
    • Using Event, Semaphore, and Mutex objects
    • Creating single-instance applications
    • Blocking locks
    • The pros & cons of locks that support thread ownership & recursion
Hybrid Thread Synchronization Constructs
This section explains how locks we use everyday leverage the best features of the user-mode & kernel-mode constructs.
  • Comparing the performance of user-mode and kernel-mode locks
  • Defining what a hybrid lock is
  • Comparing the features of the framework class library’s hybrid locks
    • ManualResetEventSlim, SemaphoreSlim, Monitors & sync blocks, ReaderWriterLockSlim
  • How reader-writer locks do what they do
  • Comparing the performance of all these locks
  • Thread synchronization construct summary: putting all the class’ concepts together
  • How to decide which thread synchronization construct to use for any particular problem
  • Other tips for avoiding thread synchronization
  • References to additional information
Instructor

richter.jpg

Jeffrey Richter is a co-founder of Wintellect; a training, debugging, and consulting firm dedicated to helping companies build better software, faster. Jeffrey has consulted with Microsoft's .NET Framework and Windows teams for many years. He is also the author of several bestselling .NET and Win32 programming books including CLR via C#, 4th Edition and Windows via C/C++, 5th Edition. Jeffrey is also a contributing editor to MSDN Magazine where he authored several columns and has written many feature articles.

"TYPE"html";}

Discover more about professional growth and skills development

contact us