Thanks, Brad and Dismounted for clear explaination.
I only have Java/J2EE programming background and just started php programming 2 month ago. I do have some doubts regarding how requests coming in. In Java world, each request will be served as a thread, and there will be concurrent issue java developer should deal with in the design. maybe PHP world is different. i,e, server can't serve two requests at the same time?
back to my question, here is another example:
code:
line 1: read forumcache string from datastore.
....................(change this string)
line 1000: write forumcache string back to datastore.
one process/thread that is serving request 1 is executing the code on line 200, then another processes/thread that is serving request 2 start executing code line 1, you can see in this case, the forumcache change on processes 2 will overwrite changes wrote by process 1.
so if I understand your reply correctly, this will never happen, because server can only serve one request at a time?
or the table is locked from line 1 until line 1000?
bear with me if I'm asking dumb question...
|