0

I have a limited list of proxies (lets say 5) that need to be logged in simultaneously (because the number of proxies may become bigger), when all of the proxies are ready, they should dynamically address one link from a list, download some data, and then proceed with another link

To login simultaneously i use Task and TaskFactory, as all of them can load at the same time, but how can i "schedule" task execution when i have a limited amount of resources (only 5 proxies at the same time)

How do i let the "proxy workers" dynamically select the next link?

user26302
  • 65
  • 6
  • A task execution is scheduled anyway (by task scheduler), while number of concurrently executing tasks you can limit by `MaxDegreeOfParallelism`. This is applicable for simple TPL constructions like `Parallel.ForXXX` as well as for TPL DataFlow blocks which can be used to execute your logic (`ActionBlock` for example). – Dmytro Mukalov Sep 27 '19 at 12:26
  • Assuming that the proxies perform I/O operations, you may find this interesting: [How to limit the amount of concurrent async I/O operations?](https://stackoverflow.com/questions/10806951/how-to-limit-the-amount-of-concurrent-async-i-o-operations) – Theodor Zoulias Sep 27 '19 at 16:41

0 Answers0