Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

[mp2] getting rid of the pool argument: msg#00283

apache.mod-perl.devel

Subject: [mp2] getting rid of the pool argument

As some of you may have followed the discussions here, we are scared to death from users using the wrong pools and shooting themselves into the foot. Really, what happens is that we take the cool easy Perl and bring back the malloc/free issue in a different reincarnation. It's the 'free' part that is going to bite us, because memory can be freed w/o a user knowing about it, if they have used the wrong pool.

We tried to make things safe and copy the string using perl's malloc, like in server_root_relative, which is slowing things down, but sort-of-OK when the string is short, and the API is not used heavily. But this copying can't be used in other APIs which potentially move mountains of data.

So it all comes to this - can we get rid of the pool argument completely and handle it behind the scenes? I think we can do that. This is still raw in my head but if we maintain a global variable (similar to Apache->request/Apache->server), switching to the right pool (pconf at the startup, server pool at child_init/exit, connection pool for filters and request pool for requests we may be able to completely get rid of it. If power users will want to use a specific pool (e.g. allocating memory from $s pool, while inside a request handler), they should be able to change the default pool via API and then restore it back (e.g. $old_pool=Apache->default_pool($new_pool)).

The question are whether 1) it's a good idea 2) it's not going to hurt the performance (remember Apache->request is bad under threads because it uses Thread Local Storage, which is supposedly slow).

Also maybe if we assume that there are never too many connections with KeepAlive, we could always use $c->pool and never $r->pool, which will simplify things a lot, with a bit of memory overhead (but re-usable). Since most setups don't use KeepAlive with mod_perl it may just work.

Againg these are just raw ideas. So please throw yours in and let's cook some nice meal.

__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxxxxxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
hardware.arm.at...    cms.citadel.dev...    video.gstreamer...    java.facelets.u...    misc.basics.qna...    web.wiki.instik...    network.uip.use...    xdg.devel/2003-...    tex.bibtex.bibd...    finance.quotesp...    ietf.zeroconf/2...    redhat.blinux.g...    suse.db2/2003-0...    php.phpesp/2004...    uml.devel/2003-...    gnome.labyrinth...    qnx.openqnx.dev...    boot-loaders.gr...    db.dataperfect....    audio.audacity....    linux.uclinux.m...    editors.j.devel...    os.openbsd.tech...    kde.users.multi...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation