|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ThreadPool queue sizeHello,
Does anyone know if there is a way to check the size of the ThreadPool wait queue should the number of available threads become busy? Thanks Hello Yofnik,
Didn't quite understand u. U mean ThreadPool.GetAvailableThreads method? Y> Hello, Y> Does anyone know if there is a way to check the size of the Y> ThreadPool Y> wait queue should the number of available threads become busy? Y> Thanks Y> --- WBR, Michael Nemtsev :: blog: http://spaces.msn.com/laflour "At times one remains faithful to a cause only because its opponents do not cease to be insipid." (c) Friedrich Nietzsche No, I mean when GetAvailableThreads returns 0 - is there a way to find
out how many tasks are waiting to access a thread. For example, say my application gets bombarded with requests - each of which is handled in its own ThreadPool thread. If the requests are coming in faster than the ThreadPool delegate can execute, eventually GetAvailableThreads will be 0. Once this happens, is there a way to find out how many requests are waiting for a ThreadPool thread to become available ? Michael Nemtsev wrote: Show quote > Hello Yofnik, > > Didn't quite understand u. > U mean ThreadPool.GetAvailableThreads method? > > Y> Hello, > Y> Does anyone know if there is a way to check the size of the > Y> ThreadPool > Y> wait queue should the number of available threads become busy? > Y> Thanks > Y> > --- > WBR, > Michael Nemtsev :: blog: http://spaces.msn.com/laflour > > "At times one remains faithful to a cause only because its opponents do not > cease to be insipid." (c) Friedrich Nietzsche No direct way. You could wrap it and increment a counter in the
queueworkitem() and decrement in the callback helper wrapper. -- Show quoteWilliam Stacey [MVP] <yof***@comcast.net> wrote in message news:1153517216.181932.324910@h48g2000cwc.googlegroups.com... | No, I mean when GetAvailableThreads returns 0 - is there a way to find | out how many tasks are waiting to access a thread. | | For example, say my application gets bombarded with requests - each of | which is handled in its own ThreadPool thread. If the requests are | coming in faster than the ThreadPool delegate can execute, eventually | GetAvailableThreads will be 0. Once this happens, is there a way to | find out how many requests are waiting for a ThreadPool thread to | become available ? | | | | Michael Nemtsev wrote: | > Hello Yofnik, | > | > Didn't quite understand u. | > U mean ThreadPool.GetAvailableThreads method? | > | > Y> Hello, | > Y> Does anyone know if there is a way to check the size of the | > Y> ThreadPool | > Y> wait queue should the number of available threads become busy? | > Y> Thanks | > Y> | > --- | > WBR, | > Michael Nemtsev :: blog: http://spaces.msn.com/laflour | > | > "At times one remains faithful to a cause only because its opponents do not | > cease to be insipid." (c) Friedrich Nietzsche | |
|||||||||||||||||||||||