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
What is concurrency?
an ability to execute different tasks simultaneously in overlapping periods and in no predefined order
What is parallelism?
an ability to process parts of one or several tasks simultaneously in parallel by different executors
What is synchronization?
a process of managing access to a scarce shared resource for concurrent tasks
Choose the terms that are related to each other, i.e. mean the same thing.
- Multiprocessing and concurrency
- Multitasking and parallelism
- Multiprocessing and parallelism
- Parallelism and concurrency
- Multitasking and concurrency
- Multiprocessing and parallelism
- Multitasking and concurrency
What does the term “thread” mean in computer science?
Thread is the unit of activity inside a process, and represents series of executable instructions.
(Alternative)
a stream of instructions inside a process that can be scheduled and run independently
Where does the internal concurrency take place?
inside the same thread