PHP 4.0 Bug #7046 Updated: shm_put_var wont put the given var into memory
| From: | stas@php.net | Date: | Sun, 10 Dec 2000 16:26:04 +0000 |
| Subject: | PHP 4.0 Bug #7046 Updated: shm_put_var wont put the given var into memory | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-40747@lists.php.net to get a copy of this message | ||
ID: 7046
Updated by: stas
Reported By: FaVo@FaVo.li
Old-Status: Open
Status: Feedback
Bug Type: Semaphore related
Assigned To:
Comments:
Failed to reproduce. Does it stil happen on 4.0.3pl1/latest
snapshot? Can you give more info on where it fails (IDs,
sizes, errors, etc.)?
Previous Comments:
---------------------------------------------------------------------------
[2000-10-05 19:31:28] FaVo@FaVo.li
I was working with shared memory segments on PHP 4.0.2, it works fine.
But sometimes (ca. 5% of the calls) it wont put my array into the memory, after a second try
sometimes third try with a timeout of 1ms it worked.
Example Code:
while (!$check_mem) {
shm_remove($shm_id);
$uid = shm_attach($shm_id, $global[ARRAY_SIZE]);
$tstamp = time();
$user_data = array (
"nick" => $cur_identity->username,
"channel" => $channel,
"input" => "",
"query" => "",
"query_stat" => "",
"cybernode" => $cur_identity->cybernode_key,
"timestamp" => $tstamp,
"color" => 2,
"channel_info" => 1,
"voice" => 1,
"level" => $user_level
);
$check_mem = shm_put_var($uid, $shm_id, $user_data);
if (!$check_mem) echo "*";
usleep(1);
}
I needed the while-loop and usleep to check if it was successfull.
When i removed the usleep i had about 80 stars (*) sometimes, but worked after that many tries. With
the usleep it just needs 2 sometimes 3 tries.
But its only at about 5% of the calls (tried this one with about 700 script calls after i saw it).
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7046