I have good expereince in Java/J2EE but I am very new to PHP. There is an small requirement where i want to share value of a variable(which contains a String token)
accross different user requests. Now the issue is that i want to make the read and write of this variable thread safe i. at a time only one user can read/write
in this variable.
If i was to do it in Java i would just take lock on a object by using synchonized keyword and can put the code block(read/write) in synchronzed block.
Here in PHP i have put the token in GLOBALS array but i am not getting any way by which i can made the read and write of this variable thread safe. I am avoiding
to use any external library to avoid depdency. Please guide me how this can be achived.