Thread Question
Ritesh Raj Sarraf
riteshsarraf at gmail.com
Thu Aug 3 07:49:45 EDT 2006
Simon Forman wrote:
>
> The other threads will just take the next request from the Queue and
> process it. They won't "care" what the one thread is doing,
> downloading, zipping, whatever.
>
As I mentioned in my previous post, the other threads will also have to
go through the same "zip the file if the download was successful"
method.
I implemented it but am seeing some issues.
If I use a single thread, all files are zipped to the archive.
Obviously this has to work.
If threads are 2 or 3 or 4 in numbers, some of the files don't show up
in the archive.
What would a thread do (which wants to add files to an archive) if it
finds that another thread has opened the archive in append mode ?
Will it wait, overwrite or just die ?
Looking at the way my program is behaving, it looks like at that
condition the threads are skipping/dying or something like that.
Ritesh
More information about the Python-list
mailing list