note 48785 added to ref.shmop

From: Date: Thu, 06 Jan 2005 23:19:58 +0000
Subject: note 48785 added to ref.shmop
Groups: php.notes 
Request: Send a blank email to php-notes+get-82873@lists.php.net to get a copy of this message
Since there is no mention of the (lack of) need for locking here, I took a look into the shmop.c extensions code. So correct me if I'm wrong, but the shmop.c extension uses memcpy() to copy strings to and from shared memory without any form of locking, and as far as I know, memcpy() is not atomic. If that's true as I suspect, then these 'easy to use' functions are not so 'easy to use' any more and have to be wrapped in locks (e.g. semaphores, flocks, whatever). ---- Manual Page -- http://www.php.net/manual/en/ref.shmop.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+48785 Delete -- http://master.php.net/manage/user-notes.php?action=delete+48785&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48785&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48785&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48785&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48785&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48785&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+48785&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#82873) next »