users@grizzly.java.net

finding out the available threads in a thread pool

From: Carla Mott <carla.mott_at_oracle.com>
Date: Thu, 09 Sep 2010 14:36:50 -0700

Hi,

I'm writing a command in glassfish and we found that we can potentially
end up with a deadlock. The issue is that some commands use 2 threads
to complete the operation. When we run the command simultaneously can
run into a deadlock.

We have increased the size of the pool but doesn't solve the problem. I
would like to get the max size and either the number of threads in use
or the number available so I can figure out if I should attempt the
operation. It seems that the only thing that I'm able to find out is the
max poll size number. Is there any way to figure out the info I'm
looking for?

Thanks,
Carla