Can you help me understand the Global Interpreter Lock in Python

0 votes
Can someone explain the concept of the global interpreter lock and why it is considered to be an issue
Nov 23, 2018 in Python by charlie_brown
• 7,720 points
696 views

1 answer to this question.

0 votes

Suppose you have multiple threads which don't really touch each other's data. Those should execute as independently as possible. If you have a "global lock" which you need to acquire in order to (say) call a function, that can end up as a bottleneck. You can wind up not getting much benefit from having multiple threads in the first place.

To put it into a real world analogy: imagine 100 developers working at a company with only a single coffee mug. Most of the developers would spend their time waiting for coffee instead of coding.

None of this is Python-specific - I don't know the details of what Python needed a GIL for in the first place. However, hopefully it's given you a better idea of the general concept.

answered Nov 23, 2018 by aryya
• 7,460 points

Related Questions In Python

0 votes
1 answer

Can someone help me understand timedelta in Python?

Because timedelta is defined like: class datetime.timedelta([days,] [seconds,] ...READ MORE

answered Jan 16, 2019 in Python by charlie_brown
• 7,720 points
1,519 views
0 votes
0 answers

How can I use help in the python console?

Can you give the syntax to print ...READ MORE

Jun 11, 2019 in Python by Waseem
• 4,540 points
442 views
0 votes
0 answers

How can you print the date in a regular format in python?

Is there a module or package in ...READ MORE

Jun 18, 2019 in Python by Waseem
• 4,540 points
479 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,437 views
0 votes
1 answer
0 votes
1 answer

Can someone explain the behaviour of increment and decrement operators in python

down voteaccepted ++ is not an operator. It is ...READ MORE

answered May 15, 2018 in Python by aryya
• 7,460 points
1,745 views
0 votes
1 answer

How do you get the logical xor of two variables in Python?

If you're already normalizing the inputs to ...READ MORE

answered May 29, 2018 in Python by aryya
• 7,460 points
10,675 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP