antoine pitrou slvkzycypitrounet guido van rossum pythonorg writes solution counter seems fine except think perhaps close call raise ioerror instead set flag thread makes counter go zero close thread file got closed used agree gregory explicit happens wonder would gain approach apart encouraging dangerous coding practices also depends far want go merely proposing fix crashes want provide smarter close variation suggest people want need take risk course concurrency issues besides close two threads try io file c stdio library case stdio files threadsafe c level according glibc documentation httpwwwgnuorgsoftwarelibcmanualhtml_nodestreamsandthreadshtml posix standard requires default stream operations atomic ie issuing two stream operations stream two threads time cause operations executed issued sequentially buffer operations performed reading writing protected uses stream stream internal lock object implicitly acquired work done according posix rules perfectly safe case someone would try patch windows os x see test_filepy passes without crashing regards antoine _______________________________________________ pythondev mailing list pythondevpythonorg httpmailpythonorgmailmanlistinfopythondev unsubscribe httpmailpythonorgmailmanoptionspythondevpythondev40tangomucom thu 07 aug 2008 052250 0000 pythondev threadsafe file objects return