I don't use frames. Read a lot of information, are generated a static file put there, and then expired on the regeneration, not expired directly read the contents of this file, but in case of large concurrent access, because I this is an online room list, is every minute with the new, the number of visits is also very large.
Now there are 2 questions.
1. If a person comes to the access, this file is generated, will not happen to read empty situation?
2. I read the manual file_put_contents method, you can lock "lock_ex in writing to obtain an exclusive lock", I should add this parameter, but the problem is, suppose a person to access, just in the generation also added a lock, he will wait until the unlock to read again, or will be error?
Ask God for answers, thank you very much.
Reply to discussion (solution)
1, yes, no lock will happen to read empty or incomplete situation
2, will not wait to unlock and then go to read, so you need to complete several attempts to open the algorithm
Timing generation is simple, but it's too passive.
The cache generation should be completed immediately when the data is changed
1, yes, no lock will happen to read empty or incomplete situation
2, will not wait to unlock and then go to read, so you need to complete several attempts to open the algorithm
Timing generation is simple, but it's too passive.
The cache generation should be completed immediately when the data is changed
Thanks so much.