Open diablodale opened 5 years ago
The relevant code has been removed in https://github.com/krakjoe/apcu/commit/998157ac57ffe768a4023f22f32886aba5bcbcbd (also based on random files).
That could be brought back if there's motivation -- what is it that you want to do here? apcu currently works on the assumption of either thread-based or fork-based model (in the latter case the sharing is cross-process).
Ah, there is was. Got it, the INSTALL doc is outdated. If I wrote a PR to remove the old text referring to this ".shm", would you consider accepting it?
My motivation was coherency between code and doc, I saw something claimed but not implemented. It meant one or the other wasn't in sync. :-)
If I wrote a PR to remove the old text referring to this ".shm", would you consider accepting it?
Sure! There's probably more outdated stuff in there -- for example the introduction refers to support for PHP 4 and PHP 5, even though only PHP 7 is supported nowadays ^^
Hi. While reviewing the code, I think I noticed that the
apc.mmap_file_mask
feature...is not implemented.
https://github.com/krakjoe/apcu/blob/32aaf38b2474f2f4cfea763d626e59c96086b957/INSTALL#L263
I can find no call shm_open() in the codebase. I also can't find any substring searches for "shm" on the file_mask in the codebase. 🤔
And related...since the
mmap_file_mask
code creates a random temporary filename...https://github.com/krakjoe/apcu/blob/998157ac57ffe768a4023f22f32886aba5bcbcbd/apc_mmap.c#L87
that means another process (e.g. apache worker processes) will never know and use that same exact filename. Instead, another process will get another random filename and map a unique new shared file. So each process has their own unique memory-mapped shareable sections that are shared with no other process.
To get a shared-across-process effect, I think what is needed is to not create random temporary files. Instead, something similar to http://pubs.opengroup.org/onlinepubs/009695399/functions/shm_open.html or https://nullprogram.com/blog/2016/04/10/#posix-memory-mapping
Naturally, the mutex/lock code must already be in place and working for this shared-across-process to be successful. ;-)
Did I overlook something? Comments?