|
|
Choosing A Webhost: |
[mp2] getting rid of the pool argument: msg#00283apache.mod-perl.devel
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> |
|---|---|---|
| Previous by Date: | Re: cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm, Stas Bekman |
|---|---|
| Next by Date: | Re: [mp2] changing Apache->server, Stas Bekman |
| Previous by Thread: | Re: cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm, Stas Bekman |
| Next by Thread: | Re: [mp2] getting rid of the pool argument, Geoffrey Young |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive 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 |