/Tag: code

December 2018

Thread Synchronization with Lock in Python

By |2018-12-02T23:46:11+00:00December 2nd, 2018|Categories: Python, Tech|Tags: , , , , |

Why Lock() ? When 2 or more operations belonging to concurrent threads try to access the shared memory, a race condition can occur The easiest way to get around the race conditions is the use of a lock The operation of a lock is simple when a thread wants to access a portion of shared [...]

Defining a Thread in Python

By |2018-12-02T18:36:24+00:00December 2nd, 2018|Categories: Engineering, Python, Tech|Tags: , , , |

The Python Threading Module Python manages a thread via the threading package It provides some very interesting features that make the threading-based approach easier The threading module provides several synchronization mechanisms that are very simple to implement Major Components of Threading Module thread object lock object RLock object semaphore object condition object event object Defining [...]