users@glassfish.java.net

Re: WorkManager queue size

From: FredrikJ <fredrik_at_robotsociety.com>
Date: Fri, 24 Apr 2009 00:34:04 -0700 (PDT)

Jagadish Prasath Ramu wrote:
>
> Yes, it represents the work-manager's usage of threads.
> You can dedicate the thread-pool (asadmin create-thread-pool) only for a
> particular task and hence the statistics will be the real representation
> of the task that you are trying to monitor.
>

Let me try to explain what I mean a bit better;

One thread pool will have many short-lived CommonWorkManagers associated
with it. The reason for this is that a new CommonWorkManager is created
every time I ask the WorkManagerFactory for a work manager.

When I ask the CommonWorkManager for the queue size, I would expect to get
the queue size of the thread pool, which is what I think you mean in your
reply as well.

But I don't. I basically get the number of task that I have added to this
particular CommonWorkManager (on the current thread, in the current
invocation scope). This count is completely unrelated to the thread pool's
queue size or thread usage.

So when you say 'it represents the work-manager's usage of threads', I think
that is not currently the case at all. The CWM will only live between my
call to the factory and to I have added my task local to my current thread
and method invocation.
-- 
View this message in context: http://www.nabble.com/WorkManager-queue-size-tp23158627p23211377.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.