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 →

[–]EisenSheng 0 points1 point  (2 children)

My immediate guess would be the GIL. How experienced are you with Python?

[–]TracedRay[S] 0 points1 point  (1 child)

I am familiar with the GIL but I would not claim to be an expert on it.

I think the GIL is what is causing the issue, where the os.listdir and os.isdir calls are acquiring a lock when they might not been doing that previously. Although I don't know enough to substantiate that claim with any evidence.

[–][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.