Answer 2

When the thread that has acquired a lock terminates abruptly, there are multiple possible scenarios based on how the lock was acquired.

If the lock was acquired through the use of a with statement in Python, then the lock will be released as soon as the thread terminates.

If the lock was acquired inside the try-except-final approach, then the lock will be freed as the exception propagates to the final statement.  

If the lock was acquired without any kind of safety procedure, an abrupt termination of the thread will cause a deadlock because the lock has not been freed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.39.133