Multithreading in C♯ 5.0 Cookbook.
Cookbook. Multithreading in C♯ 5.0 Cookbook is written for existing C♯ developers who want a complete, professional, and authoritative guide to multithreading. You don't need any experience with multithreaded programming to use this book.
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Packt Publishing,
2013.
|
Temas: | |
Acceso en línea: | Texto completo |
Tabla de Contenidos:
- Cover; Copyright; Credits; About the Author; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Threading Basics; Introduction; Creating a thread in C♯; Pausing a thread; Making a thread wait; Aborting a thread; Determining a thread state; Thread priority; Foreground and background threads; Passing parameters to a thread; Locking with a C♯ lock keyword; Locking with a Monitor construct; Handling exceptions; Chapter 2: Thread Synchronization; Introduction; Performing basic atomic operations; Using the Mutex construct; Using the SempahoreSlim construct.
- Using the AutoResetEvent constructUsing the ManualResetEventSlim construct; Using the CountDownEvent construct; Using the Barrier construct; Using the ReaderWriterLockSlim construct; Using the SpinWait construct; Chapter 3: Using a Thread Pool; Introduction; Invoking a delegate on a thread pool; Posting an asynchronous operation on a thread pool; Thread pool and the degree of parallelism; Implementing a cancellation option; Using a wait handle and timeout with a thread pool; Using a timer; Using the BackgroundWorker component; Chapter 4: Using Task Parallel Library; Introduction.
- Creating a taskPerforming basic operations with a task; Combining tasks together; Converting the APM pattern to tasks; Converting the EAP pattern to tasks; Implementing a cancellation option; Handling exceptions in tasks; Running tasks in parallel; Tweaking tasks execution with TaskScheduler; Chapter 5: Using C♯ 5.0; Introduction; Using the await operator to get asynchronous task results; Using the await operator in a lambda expression; Using the await operator with consequent asynchronous tasks; Using the await operator for the execution of parallel asynchronous tasks execution.
- Handling exceptions in the asynchronous operationsAvoid using the captured synchronization context; Working around the async void method; Designing a custom awaitable type; Using the dynamic type with await; Chapter 6: Using Concurrent Collections; Introduction; Using ConcurrentDictionary; Implementing asynchronous processing using ConcurrentQueue; Changing asynchronous processing order ConcurrentStack; Creating a scalable crawler with ConcurrentBag; Generalizing asynchronous processing with BlockingCollection; Chapter 7: Using PLINQ; Introduction; Using the Parallel class.
- Parallelizing a LINQ queryTweaking the parameters of a PLINQ query; Handling exceptions in a PLINQ query; Managing data partitioning in a PLINQ query; Creating a custom aggregator for a PLINQ query; Chapter 8: Reactive Extensions; Introduction; Converting a collection to asynchronous Observable; Writing custom Observable; Using Subjects; Creating an Observable object; Using LINQ queries against the observable collection; Creating asynchronous operations with Rx; Chapter 9: Using Asynchronous I/O; Introduction; Working with files asynchronously; Writing an asynchronous HTTP server and client.