RE: [PHP] Resampling images -- need lock ?
From: Martin Zvarík > kranthi napsal(a): >> yeh. if u want it to be on server side that is a good approach. but i >> feel it'll be very easy to do it with javascript... >> >> but what i did not understand is: what should happen if the user >> clicks ROTATE second time(when the script completed rotating say 5 >> images)? >> > Well, few images (etc. 5) got rotated +90 deg. and then the script got > aborted, because of the second request, which will cause another +90 deg > rotation again on all images = meaning those 5 will be again rotated +90 > = 180, the others stay 90. That's what did happen. But what _should_ happen? Should it abort the first rotate, or finish all images then rotate each a second time? The code will have to be different depending on which option you want. Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Resampling images -- need lock ?
2009/4/20 kranthi : > then u'll b needing a lock (a shared resource like a SESSION var will > do) even if u do it by javascript > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Session variables will not solve race conditions. I would either ignore the user abort, so script doesn't abort, you can use file locks, to make sure the scripts don't modify it at the same time -- Alpar Torok -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Resampling images -- need lock ?
I see... I will need this too: ignore_user_abort(true); kranthi napsal(a): i dont think flock will help in this case.. flock will b of help when u want to lock a particular file(to read/write) but it'll not help u to stop execution of a php script -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Resampling images -- need lock ?
then u'll b needing a lock (a shared resource like a SESSION var will do) even if u do it by javascript -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Resampling images -- need lock ?
kranthi napsal(a): yeh. if u want it to be on server side that is a good approach. but i feel it'll be very easy to do it with javascript... but what i did not understand is: what should happen if the user clicks ROTATE second time(when the script completed rotating say 5 images)? Well, few images (etc. 5) got rotated +90 deg. and then the script got aborted, because of the second request, which will cause another +90 deg rotation again on all images = meaning those 5 will be again rotated +90 = 180, the others stay 90. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Resampling images -- need lock ?
yeh. if u want it to be on server side that is a good approach. but i feel it'll be very easy to do it with javascript... but what i did not understand is: what should happen if the user clicks ROTATE second time(when the script completed rotating say 5 images)? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php