Outils pour utilisateurs

Outils du site


informatique:php:shared_memory

PHP and Shared Memory

Implementations

shmop_*

shmop is to provide a symple interface to shared memory that can be used with OTHER NON php shm creators.

Versions of Windows previous to Windows 2000 do not support shared memory.

Remember, that shared memory is NOT safe against simultaneous access.

shm_*

shm

This extension is not available on Windows platforms.

Remember, that shared memory is NOT safe against simultaneous access. Use semaphores for synchronization.

PHP compilation options :

  • –enable-sysvsem: To enable System V semaphore support
  • –enable-sysvshm: To enable the System V shared memory support
  • –enable-sysvmsg: To enable the System V messages support

Runtime option:

  • sysvshm.init_mem

Essais

Essais01

Création d'une block de mémoire partagée et remplissage avec plusieurs variables. Lecture de ce block et ces variables. Destruction du bloque de mémoire partagée.

code source Essais01

Essais02

Quelle est la limite de mémoire partagée.

Chez OVH c'est < 32Mo.

code source Essais02

informatique/php/shared_memory.txt · Dernière modification: 19/05/2012 00:18 (modification externe)