Download e-book for kindle: Multithreading in C# 5.0 Cookbook by Eugene Agafonov


By Eugene Agafonov

Over 70 recipes that can assist you research asynchronous and parallel programming with C# 5.0 fast and efficiently


  • Delve deep into the .NET threading infrastructure and use job Parallel Library for asynchronous programming
  • Scale out your server purposes effectively
  • Master C# 5.0 asynchronous operations language support

In Detail

In an age whilst desktop processors are being constructed to include progressively more cores, multithreading is a key issue for growing scalable, powerful, and responsive purposes. for those who fail to do it safely, it could result in difficult difficulties that take an immense period of time to solve. accordingly, having an excellent realizing of multithreading is a needs to for the fashionable program developer.

Multithreading in C# 5.0 Cookbook is an easy-to-understand advisor to the main complicated programming difficulties. This publication will advisor you thru useful examples devoted to quite a few elements of multithreading in C# on home windows and should provide you with a superb foundation of useful wisdom which you could then use to software your individual scalable and trustworthy multithreaded functions.

This ebook publications you thru asynchronous and parallel programming from uncomplicated examples to functional, real-world strategies to complicated difficulties. you'll begin from the very starting, studying what a thread is, after which continue to profit new recommendations in response to the knowledge you get from the former examples.

After describing the fundamentals of threading, it is possible for you to to know extra complex suggestions like activity Parallel Library and C# asynchronous services. Then, we flow in the direction of parallel programming, beginning with uncomplicated information constructions and progressively progressing to the extra complicated styles. The e-book concludes with a dialogue of the specifics of home windows eight software programming, supplying you with an entire knowing of the way home windows eight purposes are diversified and the way to software asynchronous purposes for home windows 8.

What you are going to examine from this book

  • Work with uncooked threads, synchronize threads, and coordinate their work
  • Develop your personal asynchronous API with activity Parallel Library
  • Use C# 5.0 asynchronous language features
  • Scale up your server program with I/O threads
  • Parallelize your LINQ queries with PLINQ
  • Use universal concurrent collections
  • Apply various parallel programming patterns
  • Work with home windows eight asynchronous APIs
  • Use Reactive Extensions to run asynchronous operations and deal with their options


This ebook is an easy-to-follow advisor filled with hands-on examples of real-world multithreading initiatives. each one subject is defined and put in context, and for the extra inquisitive readers, there also are extra in-depth information of the strategies used.

Who this e-book is written for

If you're a developer or new to multithreaded programming and also you are trying to find a brief and straightforward technique to start, then this publication is for you. it's assumed that you've got a few event in C# and .NET already, and also you must also be conversant in desktop technological know-how and easy algorithms and knowledge structure.

Show description

Read or Download Multithreading in C# 5.0 Cookbook PDF

Best c# books

New PDF release: Beginning CSharp Game Programming

Are you prepared to attempt your hand at programming video games utilizing C#? "Beginning C# online game Programming" is your excellent introductory guide—designed to jumpstart your adventure with C# and DirectX nine. It comprises the elemental issues you’ll want to know and covers extra issues that you’ll locate precious alongside the way in which.

Download e-book for iPad: Visual C Sharp 2005 Demystified by Jeff Kent

There’s no more straightforward, speedier, or more effective approach to research the quite tricky subjects
Visual C# 2005 Demystified explains the language and its libraries and functions in addition to find out how to use the built-in improvement setting. This self-teaching consultant comes entire with key issues, heritage details, quizzes on the finish of every bankruptcy, or even a last examination. easy adequate for rookies yet hard adequate for complicated scholars, this can be a energetic and interesting brush-up, introductory textual content, or lecture room complement.

Beginning Windows Phone 7 development by Henry Lee PDF

Microsoft is injecting new power into the clever mobilephone industry with the delicate home windows cellphone 7. This new power equates to new possibilities for you, the cellular developer. starting home windows mobilephone 7 improvement has been written in particular that will help you grab those possibilities and start growing purposes for this fascinating new cellular equipment platform.

Additional resources for Multithreading in C# 5.0 Cookbook

Sample text

How to do it... To understand how to use the C# lock keyword, perform the following steps: Start Visual Studio 2012. Count); Run the program. How it works... When the main program starts, it first creates an object of the class Counter. This class defines a simple counter that can be incremented and decremented. Then we start three threads that share the same counter instance and perform an increment and decrement in a cycle. This leads to nondeterministic results. If we run the program several times, it will print out several different counter values.

How it works... Performing basic operations with a task Getting ready How to do it... How it works... Combining tasks together Getting ready How to do it... How it works... Converting the APM pattern to tasks Getting ready How to do it... How it works... Converting the EAP pattern to tasks Getting ready How to do it... How it works... Implementing a cancellation option Getting ready How to do it... How it works... Handling exceptions in tasks Getting ready How to do it... How it works... There's more… Running tasks in parallel Getting ready How to do it...

Working with a database asynchronously Getting ready How to do it... How it works... Calling a WCF service asynchronously Getting ready How to do it... How it works... 10. Parallel Programming Patterns Introduction Implementing Lazy-evaluated shared states Getting ready How to do it... How it works... Implementing Parallel Pipeline with BlockingCollection Getting ready How to do it... How it works... Implementing Parallel Pipeline with TPL DataFlow Getting ready How to do it... How it works... Implementing Map/Reduce with PLINQ Getting ready How to do it...

Download PDF sample

Rated 4.82 of 5 – based on 44 votes