Results 1 to 18 of 18

Thread: Use X number of threads to perform Y number of tasks

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    Use X number of threads to perform Y number of tasks

    I want to be able to specify the number of threads to work on a common list of tasks. So for example, if I have a list of 87 files to download & I want to use 5 threads to download those files, how would I set up such a mechanism? My initial thought is to start 5 threads & each thread would retrieve the first (or maybe last) URL from the list & then immediately remove the URL from the list so that it isn't read by another thread. Does that seem like the right approach? My concern is that the same URL might be retrieved more than once if a thread doesn't remove it fast enough before another thread tries to read the next URL from the list.
    Last edited by nbrege; Jan 29th, 2024 at 03:35 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width