multithreading - Multi threading console app issue c# -


i have console app infinite loop , webrequest.

but wanted know multi threading library this.

so loop gets web request , populates results in mongo database. has done each request.

bit stuck approach ideal this?

any advice good.

thanks

you use parallel.foreach, potentially set maximum number of threads, , run operation on entire collection.

be aware multithreading require synchronize access shared data.

that being said, in scenario, of time waiting on io. such, using asynchronous method calls better threading operations, threading block multiple threads unnecessarily. msdn has nice walkthrough on accessing web using async , await converted use.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -