2. Hopes
Identify where you may need asynchronous
processing
Implement it with Background workers,Task
Parallel Library, or async & await pattern
Learn to refactor synchronous applications
into become more responsive
3. Asynchronous vs. Parallel
Who remembers my talk about boiling eggs
using the parallel extensions?
Concurrency / Boiling several eggs simultaneously
By boiling the eggs in different pots, we are
boiling them in parallel to each other.
Now if we do something else while they’re
boiling, like cleaning up the kitchen, and we
go back to them once they’re done… that
task is done asynchronously
4. Asynchronous vs. Parallel
Think of parallelism as something that runs
independently at the same time as another
task
Think of asynchronous operations as
something that will let you do things in the
meantime while you wait, but once it’s
finished, you receive the results
5. Asynchronous
It’s common to look at asynchronous
processes as non-blocking (ie the system
won’t lock up, will continue).
So how do we do this?
12. Example 3 – TPL (cont)
What happens is we’re creating a State
machine
This handles everything in the background &
keeps track of what task is running & where
so it knows where to go back