Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Cross-Platform Development with Xamarin

You're reading from   Mastering Cross-Platform Development with Xamarin Master the skills required to steer cross-platform applications from drawing board to app store(s) using Xamarin

Arrow left icon
Product type Paperback
Published in Mar 2016
Publisher
ISBN-13 9781785285684
Length 390 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (14) Chapters Close

Preface 1. Developing with Xamarin FREE CHAPTER 2. Memory Management 3. Asynchronous Programming 4. Local Data Management 5. Networking 6. Platform Extras 7. View Elements 8. Xamarin.Forms 9. Reusable UI Patterns 10. ALM – Developers and QA 11. ALM – Project and Release Management 12. ALM – App Stores and Publishing Index

Parallel execution

In the previous section, the discussion was centered on the System.Threading.Tasks namespace and the Task class. Even though tasks are the cornerstone of the task-based asynchronous model and so-called Task Parallelism, the concurrent collections namespace makes up the Data Parallelism side of the async model and provides developers with tools to execute code most efficiently and in a thread-safe manner.

BlockingCollection<T> is one of the concurrent collection implementations that encapsulates the core synchronization and coordination between threads and provides a thread-safe data storage to implement a provider-consumer model in Xamarin applications.

Using BlockingCollection<T>, we can easily implement a new method that makes use of the parallel execution from the previous example. In this implementation, our view model will be the consumer and the Fibonacci source and the range calculation tasks will be the provider.

If we were to rewrite the range calculation...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image