On 9/29/2014 8:06 PM, guilhermebla...@gmail.com wrote:
Hi,
Here is a new RFC: https://wiki.php.net/rfc/sync
Thoughts appreciated.
Cheers,
As the original author of this extension, I only have a few caveats to
point out:
1) It has a dependency on POSIX semaphores on non-Windows platforms.
From what I understand, not all platforms have support for POSIX
semaphores. I feel that if this is going to be moved to core that
someone with a deeper familiarity of POSIX support across OSes take a
look at what platforms won't be supported and whether or not anyone
actually cares about the unsupported environments. Every modern distro
I've tried has support.
2) Another consideration is the use of the code in common shared
hosting environments. If two objects share the same name but are used
differently in two different applications on the same machine, it will
result in undefined behavior. The object won't crash but it won't
necessarily behave the way it is intended to behave. This is true of
any synchronization object, but is something to be aware of as a
possible issue since the code does expose OS level synchronization
objects to web applications. Much of this issue is minimized by making
the different types of objects (Mutex, Semaphore, etc.) have unique
prefixes but it doesn't mean there can't/won't be any conflicts.
3) Creating a POSIX named object as 'root' and then attempting to open
it as another user fails with an obscure permission denied error. This
can happen if the object is initially created by a cron job that's run
as root and then a web application attempts to open the same object
later on. The userland functions posix_setuid()/posix_seteuid() and/or
posix_setgid() can be used to counter the effect. (Whether or not PHP
based cron jobs should run as the root user is a different discussion.)
4) The naming scheme of the various named objects should be examined to
make sure they conform to any existing naming conventions. For example,
the name "hello" becomes "/Sync_Mutex_hello_0" in a POSIX named mutex
object while the name is left as "hello" in a Windows named mutex object.
Just a few thoughts.
--
Thomas Hruska
CubicleSoft President
I've got great, time saving software that you will find useful.
http://cubiclesoft.com/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php