-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Discuss concurrency vs parallelism, taking inspiration from javascript (
#176)
- Loading branch information
Showing
1 changed file
with
16 additions
and
1 deletion.
There are no files selected for viewing
17 changes: 16 additions & 1 deletion
17
exercises/practice/parallel-letter-frequency/.docs/instructions.append.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
# ignore | ||
|
||
You can read about concurrency in Wren [in the manual][concurrency]. | ||
## Concurency vs. Parallelism | ||
|
||
Wren provides _concurrency_ via a construct called _fibers_. | ||
From the Wren manual: | ||
|
||
> Fibers are a bit like threads except they are cooperatively scheduled. | ||
> That means Wren doesn’t pause one fiber and switch to another until you tell it to. | ||
Wren's execution is single-threaded so we don't actually get _parallelism_. | ||
|
||
Here's a quick definition for each that illustrates the diferences between the two: | ||
|
||
- Concurrency is when two or more tasks can start, run and complete in overlapping time periods, being executed by the same processing unit. | ||
- Parallelism is when two or more tasks can start and run at the same time, being executed independently of eachother by separate processing units. | ||
|
||
Read more about [concurrency in Wren][concurrency]. | ||
|
||
[concurrency]: https://wren.io/concurrency.html |