|
-
Dec 5th, 2017, 02:12 AM
#1
Thread Starter
Member
-
Dec 5th, 2017, 02:37 AM
#2
Re: How to Handle a large number of WebClient request?
The number of concurrent tasks does indeed depend on hardware capacity but that's not an argument for or against using multiple threads. If your hardware can't handle the load then nothing will help other than better hardware. Do some research on multi-threading and parallelism to get a grounding. The WebClient class even has asynchronous methods built in. Whatever else you do though, don't do any time-consuming work on the UI, whether it's one task or 500+ per second.
-
Dec 5th, 2017, 03:39 AM
#3
Thread Starter
Member
Re: How to Handle a large number of WebClient request?
 Originally Posted by jmcilhinney
Do some research on multi-threading and parallelism to get a grounding.
Is it similar like Thread Pool or something else?
 please 
-
Dec 5th, 2017, 06:33 AM
#4
Re: How to Handle a large number of WebClient request?
The ThreadPool class is one option when it comes to multi-threading, but one of many. The idea is that, instead of creating Thread objects yourself, you simply queue up work items for the ThreadPool and it executes of on different threads as it sees fit. There are advantages in that Threads get reused so there's less overhead and the maximum number of threads is also managed for you. There are a number of instances in .NET programming where the ThreadPool is used indirectly, e.g. the BackgroundWorker class raises its DoWork event on a ThreadPool thread.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|