********************************* Synchronize Tasks On Same Machine ********************************* Problem ======= You need to synchronize tasks such that only one task runs in a certain critical section. Solution ======== Use Python's Threading module. Read more `here `_. .. literalinclude:: ..\..\..\code\HowTos\SynchronizeTasks.py :language: python :linenos: Discussion ========== A frequently occurring pattern is synchronizing multiple access to a resource on a local machine. That is, only one host per machine should access the resource at a time. Examples include: * Updating an entry in the Windows Registry. * Writing a file to a common location. * Deleting a file or directory from a common location all hosts share. * Checking if an expensive operation has been done to make sure it is performed only once. See Also ======== Other Resources """"""""""""""" * `Threading `_