Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Webcamp Zagreb 2013
Goran Peretin
October 27, 2013
Programming
1
140
Webcamp Zagreb 2013
Slides for a talk "Concurrency" that I gave at Webcamp Zagreb.
Goran Peretin
October 27, 2013
Tweet
Share
More Decks by Goran Peretin
See All by Goran Peretin
gperetin
1
190
gperetin
2
350
gperetin
1
170
Other Decks in Programming
See All in Programming
mu2in
0
140
tommykw
1
350
line_developers_tw
1
490
kazaman97
0
190
o0h
PRO
1
1.5k
decoc
1
340
line_developers_tw2
0
110
yagitatsu
3
1.4k
kazuki19992
0
450
siketyan
1
110
trajchevska
2
370
atskimura
0
300
Featured
See All Featured
tenderlove
52
3.4k
kneath
294
39k
dougneiner
119
7.8k
smashingmag
229
18k
morganepeng
17
1.1k
reverentgeek
168
7.2k
lara
172
9.5k
dougneiner
55
5.4k
jasonvnalue
82
8.1k
sachag
267
17k
lara
590
61k
samlambert
237
9.9k
Transcript
Concurrency @gperetin Sunday, October 27, 13
Goran Peretin (@gperetin) Sunday, October 27, 13
Goran Peretin (@gperetin) Sunday, October 27, 13
Goran Peretin (@gperetin) Sunday, October 27, 13
Goran Peretin (@gperetin) Sunday, October 27, 13
Sadržaj Concurrency Parallelism Problemi/rješenja Sunday, October 27, 13
Sunday, October 27, 13
Demo time! Sunday, October 27, 13
Python3 & Ruby Sunday, October 27, 13
Concurrency Izvršavanje više taskova u nekom vremenskom periodu. Sunday, October
27, 13
Parallelism Izvršavanje više taskova istovremeno. Sunday, October 27, 13
Concurrency != Parallelism Sunday, October 27, 13
Process-based concurrency task == proces Sunday, October 27, 13
Thread-based concurrency task == thread Sunday, October 27, 13
GIL (Ruby & Python) • Global Interpreter Lock • dva
threada se ne mogu izvršavati istovremeno Sunday, October 27, 13
Ruby i Python ne mogu imati thread-based parallelism. Sunday, October
27, 13
PHP Sunday, October 27, 13
PHP • PHP nema threadove • Nije thread-safe • PHP-FPM
• Apache (mod_php) Sunday, October 27, 13
Java & .NET Sunday, October 27, 13
Java & .NET Sunday, October 27, 13
Problemi? • broj procesa i threadova • RAM Sunday, October
27, 13
Blocking I/O OS pauzira thread koji napravi I/O request. Za
izvršavanje drugog requesta treba nam novi thread. Sunday, October 27, 13
Rješenja? Non-blocking I/O Lightweight processes Sunday, October 27, 13
Non-blocking I/O Twisted, Tornado EventMachine Node.js Sunday, October 27, 13
Lightweight processes Erlang (actors) Go (goroutines) --- Python (greenlets) Ruby
(fibers) Sunday, October 27, 13
Što da koristim? Sunday, October 27, 13
Hvala! Pitanja? Sunday, October 27, 13