Re: uh oh, I defined a resoruce
| From: | Sancar Saran | Date: | Mon, 14 Jan 2008 23:11:56 +0000 |
| Subject: | Re: uh oh, I defined a resoruce | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-267258@lists.php.net to get a copy of this message | ||
Hello Jochem,
>
> 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)
>
Of course, my recent project uses heavly on memcached and race conditions are
blown. So I have to implement some kind flag system to avoid race conditions.
And in same project I use $GLOBALS->['mc'] for storing memcached resource
object.
and if I was use to store some kind of data in $GLOBALS i use
$GLOBALS['data'][] = $some_data;
And of course without proper handling. You can blow yourself...
Regards
Sancar