Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion answers/os.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,18 @@ Child process cannot change variables of its parent.

## Concurrency vs Parallels? (in case single CPU core and multiple CPU cores)

To be defined.
Concurrency: executing multiple tasks at the same time but not necessarily simultaneously.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on Cambridge Dictionary, simultaneously = happening or being done at exactly the same time
image

So this sentence:

executing multiple tasks at the same time but not necessarily simultaneously.

is kinda confusing.


Parallelism: means that an application splits its tasks up into smaller subtasks which can be processed in parallel, for instance on multiple CPUs at the exact same time.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, application, subtasks and processed are not the right choices of words. We are talking about OS, where words like applicaion, process, task have their own specific meaning.
And in parallel causes confusion also. It's like one is asked to distinguish between red and blue, and his answer is "red is red, while blue is blue".


Concurrency can happen on single CPU or multiple CPUs. But Parallelism requires hardware with multiple CPUs.

A single CPU core can work on only one task at a time.

Ex:
- If multiple tasks are given to a single CPU, e.g., playing a song and writing code, it simply switches between these tasks. This switching is so fast and gives an illusion as if the tasks are running in parallel (although this is concurrent).
- If two tasks are given to a hardware with multiple CPU cores, each CPU will process a task, and two tasks will be processed in parallel.


## What is critical zone?

Expand Down