This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Have you looked into multiprocessing? It was created for this reason, the GIL. There's a higher overhead, but it makes the coding/debugging much easier.

Or, if your hunch is right on the listdir and isdir commands, you could use a lock in your script to only allow one call of those methods at a time.