harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garrett Rooney" <roo...@electricjellyfish.net>
Subject Re: [classlib]Using APR for Harmony's native link to the OS
Date Tue, 04 Jul 2006 16:06:54 GMT
On 7/4/06, Mladen Turk <mturk@apache.org> wrote:
> Garrett Rooney wrote:
> >
> > Until a version of APR exists that doesn't require the use of memory
> > pools, this approach is simply not reasonable to take.
>
> I pretty much agree with you.
> The entire tomcat-native that makes a low level network
> abstraction is very much slowed down by the fact that we
> need to create the pool for every object either socket
> or file.
>
> The entire problem would disappear if there would
> be a simple apr_free.

Unfortunately, it's not really as simple as that.  The underlying APR
allocators are optimized for quick allocation (a comparison and a
pointer increment in the common case for non-threaded apps, that plus
a mutex lock (hopefully noncontested) in threaded, IIRC) at the cost
of not providing any of the infrastructure that would allow free to
work.  Adding that sort of support would be very nontrivial.

Personally, I think a more practical approach is a separate set of
functions that create APR objects without pools, with pool based
wrappers built on top of them for use in systems that are built with
pools in mind.

Don't get me wrong, I love pools in many situations, but there are a
huge number of applications that can't use APR today because it
basically requires you to buy into the pool based approach to resource
management, which just doesn't fit all programs.

Anyway, now we're way off topic for this list ;-)

-garrett

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message