Skip to content

Commit 19c8d3a

Browse files
committed
modify concurrency
1 parent b069c4f commit 19c8d3a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

concurrency/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Parallelism vs Concurrency
22

3-
Parallelism means running two operations at the same time. For example, your program got two threads to run and your machine
3+
Parallelism means running multiple operations at the same time. For example, your program got two threads to run and your machine
44
has two core. So you can run those threads in parallel.
55

6-
A Parallel programming doesn't mean to be concurrent. Concurrency means running chunks of a program as individual
7-
executing tasks and producing right result.
6+
A Parallel program doesn't mean to be concurrent. A program that needs to be run sequentially is hard to make parallelize.
7+
Concurrency is all about breaking the code into sub program that can potentially run at the same time and at the end produce same
8+
result as if it would run as single unit. So, we cannot parallelise a concurrent program.
89

910
## Synchronous program example
1011

@@ -46,5 +47,5 @@ func printStr(str string) {
4647

4748
```
4849

49-
50+
In this concurrent program, there's 2 go routine, 1 main and another one that is declared.
5051

0 commit comments

Comments
 (0)