Hi Berin,
I just got to testing the new version of the pooling in CVS. I got the same
results as I did with my version, so that should be OK :)
I still have some problems in my load test, but that is all related to
SQLTransformer. I'll discuss that on C2-dev.
Seems to me excalibur has a loadproof pooling now :)
tomK
-----Original Message-----
From: Berin Loritsch [mailto:[EMAIL PROTECTED]]
Sent: donderdag 9 augustus 2001 15:56
To: Avalon Development
Subject: Re: [Excalibur] DefaultPool: Could not create enough components
to service your request
[EMAIL PROTECTED] wrote:
>
> Hi,
>
> The error mentioned in the subject line has been reported several times on
> this list.
>
> Now, when putting load on Cocoon 2, I got the same error. And I found the
> cause.
>
> The problem is in this piece of code:
>
> public Poolable get() throws Exception
> <snip/>
> try
> {
> m_mutex.lock();
> if( m_ready.size() == 0 )
> {
> if( this instanceof Resizable )
> {
> m_mutex.unlock();
> ((Resizable)this).grow( m_controller.grow() ); //**
> m_mutex.lock();
> if ( m_ready.size() > 0 )
> {
> obj = (Poolable) m_ready.remove( 0 );
> }
> else
> {<etc/>
I wanted to attempt a different approach first, so I had AbstractPool
implement two protected methods: internalGrow() and internalShrink().
They both assume that the lock has already been aquired and are used
inside the get() and put() methods respectively. The public Resizeable
grow() and shrink() methods aquire the lock and call the internalGrow()
and internalShrink() methods.
This makes the code snippet look like this:
<snip/>
try
{
m_mutex.lock();
if( m_ready.size() == 0 )
{
if( this instanceof Resizable )
{
this.internalGrow( m_controller.grow() ); //**
if ( m_ready.size() > 0 )
{
obj = (Poolable) m_ready.remove( 0 );
}
else
{<etc/>
Notice the absence of the m_mutex releasing of the lock. This should kill
two birds with one stone: killing the race condition, and increased
performance
through decreased iterations.
I will commit it in a few minutes, I would like you to crosscheck it on your
machine.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]