Is it better to use threads or fork in the following case

Paul Hankin paul.hankin at gmail.com
Sun May 3 16:45:36 EDT 2009


On May 3, 10:29 pm, grocery_stocker <cdal... at gmail.com> wrote:
> On May 3, 1:16 pm, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
>
> > grocery_stocker schrieb:
>
> > > Let's say there is a new zip file with updated information every 30
> > > minutes on a remote website. Now, I wanna connect to this website
> > > every 30 minutes, download the file, extract the information, and then
> > > have the program search the file search for certain items.
>
> > > Would it be better to use threads to break this up? I have one thread
> > > download the data and then have another to actually process the data .
> > > Or would it be better to use fork?
>
> > Neither. Why do you think you need concurrency at all?
>
> Okay, here is what was going through my mind. I'm a 56k dialup modem.
> What happens it takes me 15 minutes to download the file? Now let's
> say during those 15 minutes, the program needs to parse the data in
> the existing file.

If your modem is going at full speed for those 15 minutes, you'll have
around 6.3Mb of data. Even after decompressing, and unless the data is
in some quite difficult to parse format, it'll take seconds to
process.

--
Paul Hankin



More information about the Python-list mailing list