Posted by Kimmo Laine on 03/09/07 12:34
"Rik" <luiheidsgoeroe@hotmail.com> wrote in message
news:op.towf9zt1qnv3q9@misant...
> Colin McKinnon
> <colin.thisisnotmysurname@ntlworld.deletemeunlessURaBot.com> wrote:
>> andy.z@blueyonder.com wrote:
>>
>>>
>>> If 2 people try to access the same text file at the same time to write
>>> to
>>> it - what happens in PHP ?
>>>
>>
>>
>> What happens when you test it, Andy?
>
> I agree there should be some testing involved. However, how do you propose
> to test it? Writing is often very fast and tricky to time so that 2
> processen write simultaniously in a verifiable way...
Should be actually quite trivial using sleep. In pseudo code:
open handle to file x
write to filehandle current time
wait 10 seconds
write to filehandle current time
close file handle
this code run simultaneously using two browsers should demonstrate the case
of collision and the effects of it.
--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti pδivittyvδ nettisarjis
spam@outolempi.net | rot13(xvzzb@bhgbyrzcv.arg)
Navigation:
[Reply to this message]
|