mutual exclusion in PHP
Posted: Fri May 14, 2010 10:23 am
Hi all,
We have designed a web site as an assignment (please read the rest) and came to the final step. This step includes a concurrency control. Let me explain the situation with an example.
In the system the user "doctor" assigns tests for a "patient", then, when any "lab technician" logs in the system he can see the patient name and the test assigned. In this case two or more technicians may try to submit the test result at the same time. For that reason we have to detect which technician clicked the submit button first (Actually it is not submit button but we have to detect which technician clicked the link of "submit result page" first). So the other results of the technicians can be rejected. We tried adding a flag attribute in the database (MySQL) but it didn't work. Then we tried a text read/write operation as a flag holder but again we were not successful. We saw a general solution called Peterson's solution but we could not manage to put it in PHP code (we have to think also multi user case of Peterson solution).
Any kind of suggestion/help is appreciated.
Thanks.
We have designed a web site as an assignment (please read the rest) and came to the final step. This step includes a concurrency control. Let me explain the situation with an example.
In the system the user "doctor" assigns tests for a "patient", then, when any "lab technician" logs in the system he can see the patient name and the test assigned. In this case two or more technicians may try to submit the test result at the same time. For that reason we have to detect which technician clicked the submit button first (Actually it is not submit button but we have to detect which technician clicked the link of "submit result page" first). So the other results of the technicians can be rejected. We tried adding a flag attribute in the database (MySQL) but it didn't work. Then we tried a text read/write operation as a flag holder but again we were not successful. We saw a general solution called Peterson's solution but we could not manage to put it in PHP code (we have to think also multi user case of Peterson solution).
Any kind of suggestion/help is appreciated.
Thanks.