gil - the responsible to unable paralellism

Post on 13-Jul-2015

180 Views

Category:

Engineering

5 Downloads

Preview:

Click to see full reader

TRANSCRIPT

The Responsible to Unable Paralelism

GIL - Global Interpreter Lock

Geison

GIL - Global Interpreter Lock

What is GIL?

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.

GIL - Global Interpreter Lock

Problem?

GIL - Global Interpreter Lock

PerformanceDisable Parallelism

GIL - Global Interpreter Lock

Which languages interpreters implement GIL?

GIL - Global Interpreter Lock

GIL - Global Interpreter Lock

Which is the reasons to implement GIL?

GIL - Global Interpreter LockAccording to:

Guido van RossumPython Creator

Yukihiro "Matz" MatsumotoRuby Creator

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).

GIL - Global Interpreter Lock

It is possible remove GIL from this interpreters?

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

not thread-safe in this interpreters!

GIL - Global Interpreter Lock

GIL - Global Interpreter Lock

Ways to minimise the performance problem

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.

GIL - Global Interpreter Lock

Problem

Increase the amount of memory used very fast!

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:

Contact me

● Email - geisonfgf@gmail.com● Skype - geisonfgf● Facebook http://www.facebook.

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

com/geisonfgf

top related