Description
This training will show you the advantages of multithreaded processing as well as how to implement it effectively in C#. You'll see how to manage memory sharing, synchronization issues, thread pools, and development best practices.
Who is this training for ?
For whom ?
Developers, engineers, architects, project managers.
Prerequisites
Good knowledge of C# programming.
Training objectives
Training program
- Introduction
- Multiple threads: why? The objectives.
- Two models of multithreading: concurrent/parallel.
- Difficulties and challenges of multithreaded programming.
- The basic tools of the framework
- What is a thread? Components of a thread.
- Memory sharing by threads.
- The Thread class of the framework (version 2 and above).
- The need for synchronization and the lock instruction.
- Practical work Thread creation.
- Synchronization.
- Influence of the number of processors.
- Framework synchronization classes
- Windows historical synchronization objects: Event, Mutex, Semaphore.
- The equivalent classes of the framework.
- The critical sections of Windows and the Monitor class of the framework.
- The danger of fatal embrace and its detection.
- Conditional variables and the Monitor class.
- The ReadWriteLock class.
- The Interlocked class.
- Practical work Synchronization of two threads, producer and consumer of data.
- Using classes.
- Le pool de threads
- The ThreadPool and its two categories of threads.
- Setting the number of threads.
- Explicit and implicit use of worker threads.
- Practical work Explicit use of pool threads.
- Using asynchronous executions
- The underlying Windows mechanics.
- The Design Pattern Begin/End and the Stream or other classes concerned.
- Asynchronous in ASP.
- NET.
- The Async Design Pattern of the socket framework.
- Practical work Writing a program using asynchronous calls.
- Code instrumentation and profiling
- Competition for data, forgetting synchronization and its granularity.
- Broken memory reads/writes, reordering of instructions.
- The use of diagnostic tools to judge the relevance of the use of threads.
- Practical work Highlighting the impact of certain application design choices.
- Program design and architecture
- Thinking/designing multithreaded and parallel.
- Threads and GUI.
- Thread vs AppDomain.