Sancar Saran schreef:
On Sunday 13 January 2008 21:42:28 Jochem Maas wrote:
no race conditions occur in code written in php? true that there is
no direct race conditions that can occur as a direct result of running code
but obviously you've never dealt with multi-user systems using a databse
backend, or file-writing based tools used in a web-environment (e.g.
template output caching) or anything that uses shared memory or trying to
guanrantee that a command-line script runs as a singleton. to name but a
few examples that can most definitely be prone to race-conditions.
Hmmm interesting so you mean
$GLOBALS['language'] = memcached->get('language');
race condition prone than
function hede() {
global $language
$language = memcached->get('language');
}
no not in the slightest. both those bits of code are identical for one
(apart from the fact that neither are valid syntax). and whatever your trying to
point out it's beside the point (I think). any possible race condition will be occuring with
the code that *sets* data into memcache (or whatever).
I don't claim to know everything there is no know about race-conditions but you
can very easily program them into a php app that's for sure. please do some reading
on the matter (e.g. google 'memcache+race+condition') - I'm quite sure you'll find
some interesting material - I know I did (just now)
Regards
Sancar
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php