Is it possible to acquire the global interpreter lock from python code? Or is that purely implemented in the C side?
Asked
Active
Viewed 970 times
3
-
7Don't you dare touch the GIL. – Rafe Kettler Jan 31 '11 at 20:48
1 Answers
7
If your code executes then you have the GIL, no need to acquire it manually.

Marek Sapota
- 20,103
- 3
- 34
- 47
-
-
2There are times when you need to do transactions (multiple commands without thread-switching). How can I guarantee this if not without explicit acquisition of the GIL? – Asclepius Nov 17 '12 at 01:07
-
If you can not do this with locks/semaphores or other things from the `threading` module you are probably doing something wrong. – Marek Sapota Dec 07 '12 at 23:01