Re: Re: Sessions: garbage collection run
| From: | Yasuo Ohgaki | Date: | Fri, 14 Dec 2001 13:01:51 +0000 |
| Subject: | Re: Re: Sessions: garbage collection run | ||
| References: | 1 2 3 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-73735@lists.php.net to get a copy of this message | ||
Ulf Wendel wrote:
Yasuo Ohgaki wrote:Some users need current behavior. i.e. User want make to do gc everytime before access. User may have complex gc code to meet their needs that requires gc at module init. I vote 0 for this change.Ulf Wendel wrote:I asked Sascha on IRC #php.de and his answer was "Good question. It might have todo with the lifetime of PS(mod_data)." If so, it's clear.Hi, being not a php source code guru I need some help on understanding the source. Why does the session module run the garbage collection from the PHP_RINIT_FUNCTION() means from php_session_start()? Does the user notice a delay caused by PHP_RSHUTDOWN_FUNCTION()? If not what's the reason not placing the GC there.I think Sascha wants to delete garbages before reading data and I can understand the reasons.
If not, there's no reason on running GC at a time where the user definetly notices the (often negliable) delay. But well, there's a lot of "if's" and I just wanna know. Someone with detailed knowledge of the internals should be able to answer my questions: - is a PHP_RSHUTDOWN_FUNCTION() delay "visible" to the user?Leave this one for others ;)
- what about the lifetime of PS(mod_data), can one still access it from within the PHP_RSHUTDOWN_FUNCTION()?Yes. It is deleted in RSHUTDOWN function. PHP_RSHUTDOWN_FUNTION -> php_session_flush() -> php_session_save_current_state() -> PS(mod)->close(&PS(mod_data)) -> efree(mdata) -- Yasuo Ohgaki