Essentials Flashcards
What is synchronous execution?
Tasks execution goes one by one; the next task starts only if the previous one finished.
What is asynchronous execution?
Tasks can start at any time; they don’t have to wait until the previous one finished.
Select the correct statements
- Asynchronous processing is possible only if there are several tasks.
- Parallel execution is impossible if there is only one task.
- Parallel processing is possible only if there are several executors.
- Asynchronous execution is only for one executor; it’s impossible for several.
- Asynchronous processing is possible only if there are several tasks.
- Parallel processing is possible only if there are several executors.
Which way is the best?
- Tell the story
- Iron your shirt and wash your clothes
- Deliver 10 packages with 10 couriers
- Tell the story - Synchronous
- Iron your shirt and wash your clothes - Asynchronous
- Deliver 10 packages with 10 couriers - Parallel
Select the correct statements
- Asynchronous tasks can’t run one by one; they must overlap each other in time.
- Synchronous tasks are outdated and are rarely used nowadays.
- A synchronous task blocks the whole process till the task is completed
- Asynchronous tasks execution process can come in parallel
- A synchronous task blocks the whole process till the task is completed
- Asynchronous tasks execution process can come in parallel
Which workflow blocks the execution until it’s finished
Synchronous
Which workflow occurs only for multiple tasks
Asynchronous
Which workflow is possible only if there are multiple executors
Parallel
What does the term “Critical section” mean?
a shared limited resource required for tasks execution
Parallelism in everyday life
A gardener can plant four rose bushes per hour. How many rose bushes can eight gardeners plant in two hours if each gardener has a shovel?
64
Concurrency in everyday life
A gardener can plant four rose bushes per hour. How many rose bushes eight gardeners could plant in two hours if they have to use one shovel in turn?
8
Select the correct statements
- Concurrency is possible only if there are several executors
- Tasks can be parallel and concurrent at the same time
- Concurrency appears only if there is a scarce shared resource
- Parallel tasks can become concurrent in some circumstances.
- Tasks can be parallel and concurrent at the same time
- Concurrency appears only if there is a scarce shared resource
- Parallel tasks can become concurrent in some circumstances.
Select correct type for the task
A browser loads a page and shows an animated icon
Concurrent
Select correct type for the task
A video game catches mouse clicks and sends data to a server
Concurrent
Select correct type for the task
Two bakers create cakes
Parallel