Question

Question


  • Name: [not set]
  • Favorite Languages: [not set]
  • Website: [not set]
  • Location: [not set]
  • About Me: [not set]

Recent Comments

  • C# Tutorial - Using The ThreadPool
    05/03/2009 - 13:38

    Hello,

    Really nice, and the comments were quite helpful too.. but I have a question; Mainly because I am concerned about this sentence from the article: This generally isn't a problem unless you are giving the pool very large quantities of work.

    I have a web service WSA (lets say this will have the main thread) and it will call another method F() within the WS. This method F() does a LOT of xml processing and database inserts and deletes, for each and every call. The website which calls this webservice is a very high volume one. There are easily more than 500 requests per minute, across multiple web servers.

    The bottomline is the method F() does a lot of work.. The Calling Thread does not need any results back from F(), so I thought I would use :
    ThreadPool.QueueUserWorkItem(F,object state) .
    I wasn't planning on using the ManualResetEvents, and even after reading the article, I don't think I need to, since I don't need the results back. Is that correct?

    My concern is, when WSA calls F(), if F() takes longer compared to the speed with which WSA itself receives the requests, what are the repercussions? I mean, will the main thread (in WSA) still be able to keep up and continue with its work irrespective of F(), or will it create problems at some point? I thought that the fact that we're calling asynchronously means that it wouldn't create problems for the main thread, but because of the high volume and the critical nature of this call, I just want to make sure.