Note that there are some explanatory texts on larger screens.

plurals
  1. POMultithreaded service, BackgroundWorker vs ThreadPool?
    primarykey
    data
    text
    <p>I have a .NET 3.5 Windows Service. I'm testing with a small application that just sleeps threads after starting them, for random timespans of 300 to 6500ms. I have various questions about this issue.</p> <ol> <li>Is <code>BackgroundWorker</code> really intended for use just in WinForms applications or is this just nonsense, how exactly is it tuned to this effect?</li> <li>I've read about <code>ThreadPool</code>s in <a href="https://stackoverflow.com/questions/2015768/threading-library-for-multithreaded-windows-service">this question</a> and <a href="https://stackoverflow.com/questions/230003/thread-vs-threadpool">this one</a>. I'm not exactly sure how much it is a problem for me that the threads would last somewhere between half a second and a few seconds. Is this reason enough to look somewhere else?</li> <li>Am I best off just creating the background threads myself?</li> </ol> <p>The real-life service will poll the database for a list of pending requests, execute threads for each of those requests (limited to a certain amount of concurrent threads) and each thread will be checking if some data exists in a database, retrieve it if it does, or download it from a streaming API, store it, and return that data. The downloading would be the part that consumes the most time.</p> <p>I would really like this question to be answered for .NET 3.5 Framework, but if there are better or more efficient ways to accomplish this under .NET 4.0, I would like to read about them too. Links with more info are also very much welcome.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload