gil - the responsible to unable paralellism

18
The Responsible to Unable Paralelism GIL - Global Interpreter Lock

Upload: geison-flores

Post on 13-Jul-2015

180 views

Category:

Engineering


5 download

TRANSCRIPT

Page 1: Gil - the responsible to unable paralellism

The Responsible to Unable Paralelism

GIL - Global Interpreter Lock

Page 2: Gil - the responsible to unable paralellism

Geison

Page 3: Gil - the responsible to unable paralellism

GIL - Global Interpreter Lock

What is GIL?

Page 4: Gil - the responsible to unable paralellism

GIL - Global Interpreter Lock

Mechanism used in computer language interpreters to synchronize the execution

of threads so that only one thread can execute at a time.

Page 5: Gil - the responsible to unable paralellism

GIL - Global Interpreter Lock

Problem?

Page 6: Gil - the responsible to unable paralellism

GIL - Global Interpreter Lock

PerformanceDisable Parallelism

Page 7: Gil - the responsible to unable paralellism

GIL - Global Interpreter Lock

Which languages interpreters implement GIL?

Page 8: Gil - the responsible to unable paralellism

GIL - Global Interpreter Lock

Page 9: Gil - the responsible to unable paralellism

GIL - Global Interpreter Lock

Which is the reasons to implement GIL?

Page 10: Gil - the responsible to unable paralellism

GIL - Global Interpreter LockAccording to:

Guido van RossumPython Creator

Yukihiro "Matz" MatsumotoRuby Creator

Page 11: Gil - the responsible to unable paralellism

GIL - Global Interpreter Lock● Increased speed of single-threaded programs (no necessity to acquire

or release locks on all data structures separately)

● Easy integration of C libraries that usually are not thread-safe.

● Ease of implementation (having a single GIL is much simpler to implement than a lock free interpreter or one using fine grained locks).

Page 12: Gil - the responsible to unable paralellism

GIL - Global Interpreter Lock

It is possible remove GIL from this interpreters?

Page 13: Gil - the responsible to unable paralellism

We can not eliminate it because memory management(internal data structures) is

not thread-safe in this interpreters!

GIL - Global Interpreter Lock

Page 14: Gil - the responsible to unable paralellism

GIL - Global Interpreter Lock

Ways to minimise the performance problem

Page 15: Gil - the responsible to unable paralellism

GIL - Global Interpreter Lock

Use separate processes to achieve full parallelism, as each process has its own interpreter and in turn has its own GIL.

Page 16: Gil - the responsible to unable paralellism

GIL - Global Interpreter Lock

Problem

Increase the amount of memory used very fast!

Page 17: Gil - the responsible to unable paralellism

GIL - Global Interpreter LockIn fact, there are ways to implement interpreters without GIL, below there is a list of environments that do not have GIL where you could run your favority language:

Page 18: Gil - the responsible to unable paralellism

Contact me

● Email - [email protected]● Skype - geisonfgf● Facebook http://www.facebook.

com/geisonfgf● Twitter http://www.twitter.

com/geisonfgf