php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #14208 shm_put_var problem and new shm functions
Submitted: 2001-11-24 08:57 UTC Modified: 2021-03-14 04:22 UTC
Votes:38
Avg. Score:2.9 ± 1.4
Reproduced:10 of 15 (66.7%)
Same Version:6 (60.0%)
Same OS:8 (80.0%)
From: duncan at emarketeers dot com Assigned: cmb (profile)
Status: No Feedback Package: Semaphore related
PHP Version: 4.0.6 OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: duncan at emarketeers dot com
New email:
PHP Version: OS:

 

 [2001-11-24 08:57 UTC] duncan at emarketeers dot com
Apologies for posting this here, but I don't know where else to go.

shm_put_var has a problem in that when you try to write a variable which already exists, the function will fail if there is not enough free space for the variable and its old value. I have a patch which will simply overwrite the old value if the lengths are the same, and will do more intelligent space checking if they are not. I will submit this when I get back to the office.

I also have developed a set of additional shm functions which implement an LRU cache. These functions are handy for eg caching serialized objects which would otherwise have to be fetched from a database. And of course they are shared across the system.

My question is: how do I submit these new functions for inclusion in the source?

Patches

mulOMpUR (last revision 2020-08-28 15:34 UTC by sample at email dot tst)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-18 12:53 UTC] andrey@php.net
 Where is the patch?
 [2003-01-20 10:18 UTC] andrey@php.net
The mail from Duncan :
It makes updates twice as fast.

My LRU code is knocking around somewhere, but I'll have to do some rummaging if you want it.

367c367,376
<               php_remove_shm_data(ptr, shm_varpos);
---
>               shm_var = (sysvshm_chunk*)((char*)ptr +  shm_varpos);
>               /* Check the new length against the old length */
>               if(shm_var->length != len ) {
>                       /* If not equal, remove the old entry and prepare to create a new one */
>                       php_remove_shm_data(ptr, shm_varpos);
>               } else {
>                       /* If equal, just copy the new data across and return */
>                       memcpy(&(shm_var->mem),data,len);
>                       return 0;
>               }
 [2003-01-20 11:49 UTC] iliaa@php.net
Please send further patches in unified format, it makes it much easier to read :)
 [2003-05-31 10:32 UTC] andrey@php.net
Assigning to Wez since he implemented sysvmsg. Hopefully he will review the patch ;)
 [2010-12-01 16:09 UTC] jani@php.net
-Package: Feature/Change Request +Package: Semaphore related -Assigned To: wez +Assigned To:
 [2020-08-28 15:34 UTC] sample at email dot tst
The following patch has been added/updated:

Patch Name: mulOMpUR
Revision:   1598628864
URL:        https://bugs.php.net/patch-display.php?bug=14208&patch=mulOMpUR&revision=1598628864
 [2021-03-03 12:39 UTC] cmb@php.net
-Status: Analyzed +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-03-03 12:39 UTC] cmb@php.net
What is the status here?  Is this still relevant for anybody?  If
so, please provide a pull request[1].

[1] <https://github.com/php/php-src/pulls>
 [2021-03-14 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 06:01:30 2024 UTC