[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Repeated operations with perl bindings create new connections

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2006-11-06 16:52:42 CET

On 11/5/06, Brian Buesker <bbuesker@qualcomm.com> wrote:
> Erik Huelsmann wrote:
> > On 11/4/06, Brian Buesker <bbuesker@qualcomm.com> wrote:
> >> Why is it that every operation creates a new connection or tunnel? I
> >> could see if the perl bindings weren't smart enough to cache connections
> >> where a new connection might be used each time, but it seems inefficient
> >> to just leave the previous connections open until the perl process
> >> terminates. This behavior seems to occur with other operations as well
> >> (such as mkdir).
> >
> > Connections are cleaned up when you clean up the pool in which the
> > connection is created. The perl bindings provide a default pool which
> > is destructed at the end of the process life, which is why you're
> > seeing cleanup at program end.
> >
> > Use your own pool, or create/cleanup default pools in logical
> > locations and you should see the number of connections drop.
> Thanks for the help. That sure did result in the connections being
> cleaned up. I'm still curious though. If the connections that are stored
> within the default pool are not reused for subsequent operations, what
> is the reason for keeping them around?

The connections are not associated *with* the pool, but just allocated
*inside* the pool. Until the pool gets cleaned, they stay around,
because all resources get cleaned up when the pool is disposed of.
There's no way to retrieve the connections within a pool: a pool
doesn't know what it's storing.

> Does this just make the
> implementation easier, or is there another motivation for keeping these
> connections around?

Yes: it's the pool model for allocating and destructing resources.

bye,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Nov 6 16:54:59 2006

This is an archived mail posted to the Subversion Users mailing list.