shm_remove/shm_attach
| From: | Priebe, Jason | Date: | Fri, 03 Nov 2000 20:47:33 +0000 |
| Subject: | shm_remove/shm_attach | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-23639@lists.php.net to get a copy of this message | ||
I'm having a little trouble with shm_remove() and shm_attach().
Under some circumstances, calling shm_attach() right after
calling shm_remove() with the same key will cause an error:
shmget() failed for key 0x4f415301: File exists
I'm checking the return value of shm_remove(), and it is fine
(in any case, even if I were unsuccessful at removing the shared
memory segment, I should still be able to attach).
If I rerun the code a few seconds later, it runs fine (of course,
there's nothing to remove, since the first instance of the program
removed the shared memory).
Is it unsafe to try to immediately attach to a shared memory
segment that you've just removed?
Jason Priebe
WRAL OnLine
http://www.wral-tv.com/