in Python by
Q:
What is GIL and what are some of the ways to get around it?

1 Answer

0 votes
by

GIL stands for the Global Interpreter Lock and it is a mechanism Python is using for concurrency. It is built in deep into Python system and it is not possible at the moment to get rid of it. The major downside of GIL is that it makes threading not truly concurrent. It locks the interpreter, and even though it looks like you are working with threads, they are not executed at the same time, resulting in performance losses. Here are some ways of getting around it:

multiprocessing module. It lets you spawn new Python processes and manage them the same way you would manage threads

asyncio module. It effectively enables asyncronous programming and adds the async/await syntax. While it does not solve the GIL problem, it will make the code way more readable and clearer.

Stackless Python. This is a fork of Python without GIL. It’s most notable use is as a backend for the EVE Online game.

Click here to read more about Python
Click here to read more about Insurance

Related questions

0 votes
asked Jul 2, 2020 in Python by GeorgeBell
0 votes
asked Jun 30, 2020 in Python by GeorgeBell
+1 vote
asked Jul 16, 2020 in Python by GeorgeBell
0 votes
asked Jul 10, 2020 in Python by GeorgeBell
0 votes
asked Jun 29, 2020 in Python by Robindeniel
...