Skip to content

Commit 0abc317

Browse files
author
Markus Ho-Yen
committed
Merge branch 'master' of https://github.com/mahoyen/Exercise1
2 parents 8f05ef6 + a5f8e17 commit 0abc317

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

Part3/README.md

+14-9
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,35 @@ To complete this exercise you will have to use git. Create one or several commit
66
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.
77

88
### 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.
1010

1111
### 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.
1313

1414
### What kinds of problems motivates the need for concurrent execution?
1515
(Or phrased differently: What problems do concurrency help in solving?)
16-
> *Your answer here*
16+
Concurrency lets you do things at the same time.
1717

1818
### Does creating concurrent programs make the programmer's life easier? Harder? Maybe both?
1919
(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.
2121

2222
### 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.
2426

2527
### Which one of these do `pthread_create()` (C/POSIX), `threading.Thread()` (Python), `go` (Go) create?
26-
> *Your answer here*
28+
green threads
2729

2830
### 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.
3033

3134
### 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.
3336
3437
### 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

Comments
 (0)