The Dart VM is single-threaded, so all of an app's code runs in one thread, also called the main isolate. This is because main()
is the function where Dart code starts executing an isolate, because Dart's concurrency model is based on isolates as separate processes that exchange messages. We will talk about isolates in depth in the coming recipes, but if your code doesn't start a new isolate, all of it runs in one isolate. But, in this one isolate, you can have lots of asynchronous pieces of code (let's call them tasks) running at the same time; in what order do they execute, and can we influence that order? It turns out that a better understanding of Dart's event loop and task queuing mechanism enables us to do that. This recipe will clarify Dart's scheduling mechanism and give you hints and tips for an ordered execution of tasks.
DART Cookbook
By :
DART Cookbook
By:
Overview of this book
Table of Contents (18 chapters)
Dart Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Working with Dart Tools
Structuring, Testing, and Deploying an Application
Working with Data Types
Object Orientation
Handling Web Applications
Working with Files and Streams
Working with Web Servers
Working with Futures, Tasks, and Isolates
Working with Databases
Polymer Dart Recipes
Working with Angular Dart
Index
Customer Reviews