924
Lectures Watched
Since January 1, 2014
Hundreds of free, self-paced university courses available:
my recommendations here
Peruse my collection of 275
influential people of the past.
View My Class Notes via:
Receive My Class Notes via E-Mail:

VIEW ARCHIVE


Contact Me via E-Mail:
edward [at] tanguay.info
Notes on video lecture:
Concurrency Challenges
Choose from these words to fill the blanks below:
background, response, actual, middleware, operations, SQLite, software, RenderScript, communication, low, core, queue, concurrency, quad, POSIX, simultaneously, vision
•
prime reason for concurrency
•
leveraging advances in hardware and software
•
it's hard to buy a computing device that has just one         
•
today there are even         -core Android phones
•
historically
•
event driven architecture
•
one thread
•
for blocking operations, had to post on message           , then handle it later on an event loop
•
awkward to program
•
hard to optimize
•
used the reactor pattern
•
now operating system and                      have better concurrency support
•
Android provides several concurrency frameworks which enable multiple threads to perform long-running computations in the                     
•
this maps efficiently onto multiple cores
•
these background operations can block independently of the UI thread
•
using these frameworks effectively requires knowledge of concurrency patterns
•
e.g. worker thread pattern:
•
increasing performance
•
via parallelism
•
overlaps computation and                            mechanisms
•
background threads that download images can run in parallel with each other, and with a thread that interacts with the user
•
use the                          framework
•
targeted at image processing, computational photography, or computer             
•
improve responsiveness
•
even with one core, concurrency can be used to improve perceived                  time
•
e.g. ensures that the user interface doesn't ignore input while other                      are running
•
challenges
•
accidental complexities
•
written in programs like C
•
pthread
•
low-level and error-prone data types
•
casting disable compile-time type checking, causes errors
•
some types are not compatible on other platforms, e.g. non-           platforms
•
most operating systems today have these kinds of problems when       -level programming languages like C are used
•
developers use tools that aren't set up to handle                       
•
you need tools that enable you to drill down and look inside your                  to figure out what is happening
•
the behavior you see in the debugger doesn't necessarily reflect the behavior in the              software
•
inherent complexities
•
scheduling and synchronization
•
the order and time that operations are performed
•
ensure that multiple concurrent threads don't                              execute in criticial sections of a program at the same time
•
analogy:
•
air traffic controllers share runway resource for mulitple planes
•
likewise, Android needs to synchronize access to the              contact database
•
ensures that threads are given proper access to system resources
•
deadlock
•
two or more competing actions are waiting for the other to finish and so neither ever do
•
need to be identified and removed
•
heisenbug
•
bugs that change their behavior when observed
•
you may use a debugger to step through one thread while other threads are running

Vocabulary:

heisenbug, n. a software bug that seems to disappear or alter its behavior when one attempts to study it ⇒ "Heisenbugs occur because common attempts to debug a program, such as inserting output statements or running it in a debugger, usually modify the code, change the memory addresses of variables and the timing of its execution."
Concurrency Challenges