You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Part3/README.md
+14-9
Original file line number
Diff line number
Diff line change
@@ -6,30 +6,35 @@ To complete this exercise you will have to use git. Create one or several commit
6
6
When answering the questions, remember to use all the resources at your disposal. Asking the internet isn't a form of "cheating", it's a way of learning.
7
7
8
8
### What is concurrency? What is parallelism? What's the difference?
9
-
> *Your answer here*
9
+
Concurrent, perceived to run at the same time. parallelism is actually at the same time, but needs multicore system.
10
10
11
11
### Why have machines become increasingly multicore in the past decade?
12
-
> *Your answer here*
12
+
Because we have reached a limit in computing power with regards to energy usage.
13
13
14
14
### What kinds of problems motivates the need for concurrent execution?
15
15
(Or phrased differently: What problems do concurrency help in solving?)
16
-
> *Your answer here*
16
+
Concurrency lets you do things at the same time.
17
17
18
18
### Does creating concurrent programs make the programmer's life easier? Harder? Maybe both?
19
19
(Come back to this after you have worked on part 4 of this exercise)
20
-
> *Your answer here*
20
+
It is more complicated, but you gain better functionality. Easier to run when they are separate.
21
21
22
22
### What are the differences between processes, threads, green threads, and coroutines?
23
-
> *Your answer here*
23
+
Threads communicate through shared memory, whilst processes do not.
24
+
Green threads are threads scheduled by a runtime library or VM.
25
+
Coroutines are scheduled using cooperative multitasking.
24
26
25
27
### Which one of these do `pthread_create()` (C/POSIX), `threading.Thread()` (Python), `go` (Go) create?
26
-
> *Your answer here*
28
+
green threads
27
29
28
30
### How does pythons Global Interpreter Lock (GIL) influence the way a python Thread behaves?
29
-
> *Your answer here*
31
+
> Only one thread can operate on python objects and Python/C APi functions at one time.
32
+
Works great for single core computers, but not multicore.
30
33
31
34
### With this in mind: What is the workaround for the GIL (Hint: it's another module)?
32
-
> *Your answer here*
35
+
> Eventlet is capable of concurrency.
33
36
34
37
### What does `func GOMAXPROCS(n int) int` change?
35
-
> *Your answer here*
38
+
> GOMAXPROCS sets the maximum number of CPUs that can be executing
39
+
simultaneously and returns the previous setting. If n < 1, it does not change the current setting.
40
+
This call will go away when the scheduler improves.
0 commit comments