Threading issue: [Error 9]: bad file descriptor

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


In article <KaQNa.394960$Vi5.10189553 at news1.calgary.shaw.ca>,
Kevin <other at cazabon.com> 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 pythoncraft.com)           <*>         http://www.pythoncraft.com/

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




More information about the Python-list mailing list