Home All Groups Group Topic Archive Search About

ThreadPool queue size

Author
21 Jul 2006 4:32 PM
yofnik
Hello,
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

Author
21 Jul 2006 5:32 PM
Michael Nemtsev
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
Author
21 Jul 2006 9:26 PM
yofnik
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
Author
24 Jul 2006 1:46 AM
William Stacey [MVP]
No direct way.  You could wrap it and increment a counter in the
queueworkitem() and decrement in the callback helper wrapper.

--
William Stacey [MVP]

<yof***@comcast.net> wrote in message
Show quote
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
|

AddThis Social Bookmark Button