Hi,
On 21.12.2012 11:24, Patrick Schaaf wrote:
I understand your sentiment.
And I try to understand your technical point of view. I've thought
that PHP handles concurrent stuff so that those kind of things
won't happen and the user won't need to have for example mutexes
to do stuff.
But I think I've been wrong and for performance sake there isn't
stuff like that.
I understood you correctly using temp file and then rename should fix
that? Like this?
<?php
if ($argv[1] > 0) {
while ($argv[1]--)
{
file_put_contents('test.tpl.tmp', "<?php #".str_repeat('A',
mt_rand(4000, 5000))." ?>\n", LOCK_EX);
rename('test.tpl.tmp','test.tpl');
}
} else {
$p2 = popen("php test3.php 100", "r");
while (1) include 'test.tpl';
}
?>
Tested that quickly and cannot get it to do bus error.
Or how should you then do that stupid example so that it won't
crash? It might maybe help me, to find something in my production
code to fix and get rid of the problem.
But I think that include/require should have warning box saying
something about including/requiring files that you might overwrite
in other instance as I can't be only one expecting PHP to handle
these kind of situations.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php