Multithreading in python has a lock provided. One can access it using from threading import lock
I understand that because of GIL in python only one thread can use the python interpreter. Now if that is the case can somebody please help me understand what could possibly be the use of this lock
exposed by the threading library.
I would appreciate it if you can explain with an example
I belive you still need ordering, and waiting for other threads. Python still creates many threads they just run one at the time. If you need some synchronization that where locks come into play. The lock is also used by context managers.