jQuery

elevateZoom (Requires jQuery)

Microsoft Store (Donation)


Facebook Messenger (Donation)


Many donors of this blog prefer to donate their money through Facebook Messenger!

Click here to go to this blog's Facebook Page!

Thank you!

Activation Code - Donation (Multiple Options)



Donate

Request Web\PHP\JavaScript\HTML Project !

Contact us if you want us to develop a Web\PHP\JavaScript\HTML project for you!

Advertise On This Blog!

If you want a Product\Service\Event to be advertised on this blog, feel free to contact us!

Ads (Reserved)

Thursday, November 5, 2020

[PHP] Check_File_Write_Queue(Function)

Like PHP built-in "flock()" function, "Check_File_Write_Queue()" function can be used to queue almost all, if not all, Requests\Tasks in PHP, and as the former, the latter function was mainly written to handle file write queue!

An interesting difference between the 2 functions is that, "Check_File_Write_Queue()" is more precise than "flock()", for example, if "Add A" is clicked 5 times at once, then "Add B" is also clicked 5 times at once, the output in "Edit_File_Content.txt" file from "Check_File_Write_Queue()" will always be "AAAAABBBBB" and from "flock()" will vary, "AAABBABBBA", "BBAABBAABA", "ABABBBAABA", "BBBBBAAAAA", "AAAAABBBBB", etc, which means that "Check_File_Write_Queue()" always handles the requests in the correct order and "flock()" sometimes does and sometimes does not!
 
"Check_File_Write_Queue()" function:


Same as above, but "flock()" function used instead:

No comments:

Post a Comment

ADS - Multi Share Calculator

https://windowsportableapps.blogspot.com/2019/03/multi-share-calculator.html