[MacPorts] #38316: php54 port missing sysv extensions

MacPorts noreply at macports.org
Tue May 28 06:03:27 PDT 2013


#38316: php54 port missing sysv extensions
----------------------+---------------------------------------------
  Reporter:  bas@…    |      Owner:  ryandesign@…
      Type:  request  |     Status:  assigned
  Priority:  Normal   |  Milestone:
 Component:  ports    |    Version:  2.1.3
Resolution:           |   Keywords:  sysv, sysvmsg, sysvsem, sysvshm
      Port:  php54    |
----------------------+---------------------------------------------

Comment (by bas@…):

 Replying to [comment:2 ryandesign@…]:
 > bas, can you provide guidance on the above?

 I'll be glad to.

 '''sysvshm''' and '''shmop''' extensions are basically wrappers around the
 *nix System V IPC shared memory subsystem. They basically wrap the same
 low level functions, but differ in level of abstraction. The sysvshm
 extension uses a proprietary format for storing and reading shared memory
 blocks, which makes it impossible to use IPC shared memory blocks created
 by external non-PHP processes. The shmop extension is more low level,
 allowing you to store raw data in a shared memory block.

 '''sysvsem''' extension basically implements System V semaphores.
 Frequently used for establishing critical paths in a multithreaded
 environment. PHP does not support native multithreading, but with forking
 it is possible to have multiple threads active, albeit in different
 processes.

 '''sysvmsg''' extension implements System V message queuing. It exposes
 functions to create and delete a queue and push / pop messages on the
 queue.

 Typically, all of the above extensions are used in CLI PHP scripts to
 achieve Inter-Process Communications (IPC). In the absence of true multi-
 threading, it is common that a script will fork itself into several worker
 processes to emulate a true multithreaded program as close as possible.
 Typical multithreading issues like race conditions are combated with
 semaphores, while shared memory and message queues are used to exchange
 information. Since the different threads do not run in the same process,
 directly exchanging variables is not possible. While there are other
 options to achieve IPC (unix pipes, sockets, filesystem, database), shared
 memory and message queues are potentially less complex to implement.

 My recommendation would be to keep these extensions bundled into one IPC
 option. The extensions are perfectly usable on an individual basis, but
 will often be used in combination with each other. Personally, I can see
 why you suggested to split the sysv_* and shmop extensions. The shmop
 extension is not prefixed with sysv after all. But as far as I know, they
 both wrap the same low level libraries.

-- 
Ticket URL: <https://trac.macports.org/ticket/38316#comment:3>
MacPorts <http://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list