Threading issue: [Error 9]: bad file descriptor

Aahz aahz at
Sun Jul 6 18:56:15 CEST 2003

In article <KaQNa.394960$Vi5.10189553 at>,
Kevin <other at> wrote:
>Has anyone else run into random IOErrors ([Error 9] bad file
>descriptor) in multi-threaded Python apps?
>The app I'm running into this with (once in a while... not really
>repeatable predictably) is using 3 threads, and I'm using locks around
>all shared objects.  The error seems to be happening mostly when I'm
>trying to delete a temporary file that was originally created by a
>different thread.

Sounds like the problem isn't locking per se, but lack of
synchronization.  The simple answer: never use an external object in
multiple threads.
Aahz (aahz at           <*>

"Not everything in life has a clue in front of it...."  --JMS

More information about the Python-list mailing list