note 31756 added to function.sem-get
| From: | joeldg at rack1 dot php dot net | Date: | Fri, 02 May 2003 16:39:57 +0000 |
| Subject: | note 31756 added to function.sem-get | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-47388@lists.php.net to get a copy of this message | ||
Heh, actually the above comment I added is not technically correct, it was more of an idea to
display the function.
$SHM_KEY = ftok("/home/joeldg/homeymail/shmtest.php", 'R');
$shmid = sem_get($SHM_KEY, 1024, 0644 | IPC_CREAT);
$data = shm_attach($shmid, 1024);
// we now have our shm segment
// lets place a variable in there
shm_put_var ($data, $inmem, "test");
// now lets get it back. we could be in a forked process and still have
// access to this variable.
printf("shared contents: %s\n", shm_get_var($data, $inmem));
shm_detach($data);
--
http://www.php.net/manual/en/function.sem-get.php
http://master.php.net/manage/user-notes.php?action=edit+31756
http://master.php.net/manage/user-notes.php?action=delete+31756
http://master.php.net/manage/user-notes.php?action=reject+31756