A Comparative Analysis of Race Condition Mitigation Techniques in File-Based Concurrency Using PHP and a Hybrid Control Approach
Authors
Assistant Professor Department of Computer Science, VNSGU, Surat (India)
Article Information
DOI: 10.51583/IJLTEMAS.2026.151100050
Subject Category: Computer Science
Volume/Issue: 15/11 | Page No: 669-678
Publication Timeline
Submitted: 2026-11-10
Accepted: 2026-11-15
Published: 2026-11-26
Abstract
Race conditions pose a serious risk to web applications that implement file-based storage. Files are mostly used as a lightweight storage mechanism for small amounts of data, logging, counters, and caching in PHP applications. When users access the resource concurrently, multiple PHP processes may try to read and modify the same file at the same time, resulting in lost updates, inconsistent application state, and data corruption. This issue is mostly relevant to applications that use file-based storage for counter logs, cache data and other shared resources. Several ways can resolve these issues, such as advisory file locking, atomic file operations, and database-driven synchronisation, but they offer little flexibility in correctness, scalability, and performance.
This paper provides an in-depth comparison of available techniques for resolving race conditions in PHP web applications that use file-based concurrency. It didn’t just benchmark these classic techniques; it also demonstrated their limitations. This study designed a hybrid concurrency control model based on low-level OS atomic guarantees, file-level advisory locking for critical sections, and smart retry mechanisms, which can withstand heavy concurrent loads while preventing race-condition-related errors.
Results show that the proposed hybrid algorithm achieved correct final-state updates in the experiments performed. However, its additional synchronisation operations result in higher latency and lower throughput than standalone advisory locking. The results highlight the importance of synchronisation mechanisms for both correctness and performance.
Keywords
Race Condition, PHP, File Locking, File-Based Concurrency, TOCTOU, Synchronisation, Hybrid Concurrency Control, Web-based Application, Atomic Operation
This article is licensed under a Creative Commons Attribution 4.0 International License (CC BY 4.0).
Downloads
References
1. Alidoosti, M., Nowroozi, A., & Nickabadi, A. (2022). Semantic web Racer: Dynamic security testing of the web application against race condition in the business layer. Expert Systems with Applications, 195, Article 116569. https://doi.org/10.1016/j.eswa.2022.116569 [Google Scholar] [Crossref]
2. Bishop, M., & Dilger, M. (1996). Checking for race conditions in file accesses. Computing Systems, 9(2), 131–152. [Google Scholar] [Crossref]
3. Borisov, N., Johnson, R., Sastry, N., & Wagner, D. (2005). Fixing races for fun and profit: How to abuse atime. In Proceedings of the 14th USENIX Security Symposium (pp. 303–314). USENIX Association. [Google Scholar] [Crossref]
4. Kettle, J. (2023, August 9). Smashing the state machine: The true potential of web race conditions. PortSwigger Research. https://portswigger.net/research/smashing-the-state-machine [Google Scholar] [Crossref]
5. Koch, S., Sauer, T., Johns, M., & Pellegrino, G. (2020). Raccoon: Automated verification of guarded race conditions in web applications. In Proceedings of the 35th ACM/SIGAPP Symposium on Applied Computing (pp. 1678–1687). Association for Computing Machinery. https://doi.org/10.1145/3341105.3373855 [Google Scholar] [Crossref]
6. OWASP Foundation. (n.d.). Business logic security cheat sheet. OWASP Cheat Sheet Series. https://cheatsheetseries.owasp.org/cheatsheets/Business_Logic_Security_Cheat_Sheet.html [Google Scholar] [Crossref]
7. PHP Group. (n.d.). flock. PHP Manual. Retrieved August 15, 2026, from https://www.php.net/manual/en/function.flock.php [Google Scholar] [Crossref]
8. Qiu, Z., Shao, S., Zhao, Q., & Jin, G. (2021). Understanding and detecting server-side request races in web applications. In Proceedings of the 29th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (pp. 842–854). Association for Computing Machinery. https://doi.org/10.1145/3468264.3468594 [Google Scholar] [Crossref]
9. Qiu, Z., Shao, S., Zhao, Q., Khan, H. A., Hui, X., & Jin, G. (2022). A deep study of the effects and fixes of server-side request races in web applications. In Proceedings of the IEEE/ACM 19th International Conference on Mining Software Repositories (pp. 744–756). [Google Scholar] [Crossref]
10. Silberschatz, A., Galvin, P. B., & Gagne, G. (2021). Operating system concepts (10th ed.). Wiley. [Google Scholar] [Crossref]
11. Tanenbaum, A. S., & Bos, H. (2022). Modern operating systems (5th ed.). Pearson. [Google Scholar] [Crossref]
12. Tsyrklevich, E., & Yee, B. (2003). Dynamic detection and prevention of race conditions in file accesses. In Proceedings of the 12th USENIX Security Symposium (pp. 243–256). USENIX Association. [Google Scholar] [Crossref]
13. Tulsyan, R., Pai, R., & D’Souza, D. (2020). Static race detection for RTOS applications. In Proceedings of the 40th IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (Vol. 182, Article 57, pp. 57:1–57:20). Schloss Dagstuhl – Leibniz-Zentrum für Informatik. https://doi.org/10.4230/LIPIcs.FSTTCS.2020.57 [Google Scholar] [Crossref]
14. Upadhyay, A., Laxmi, V., & Naval, S. (2023). Navigating the concurrency landscape: A survey of race condition vulnerability detectors. arXiv. https://doi.org/10.48550/arXiv.2312.14479 [Google Scholar] [Crossref]
15. Vattani, A., Chierichetti, F., & Lowenstein, K. (2015). Optimal probabilistic cache stampede prevention. Proceedings of the VLDB Endowment, 8(8), 886–897. https://doi.org/10.14778/2757807.2757813 [Google Scholar] [Crossref]
Metrics
Views & Downloads
Similar Articles
- Explainable 3D Convolutional Neural Networks Spatiotemporal Learning for Human Handshake Interaction Recognition
- Comprehensive Empirical Benchmarking of Twelve Sorting Algorithms Across Comparison-Based, Non-Comparison-Based, and Hybrid Paradigms: A Multi-Dimensional Performance Model for Algorithm Selection at Practical Data Scales (n up to 100,000)
- Reinforcement Learning for Personalized Insulin Dosing: A Comparative Study of A2C, SAC and PPO on Real-World Clinical Data
- Faculty Milestone Manager and Appraisal System: A Web-Based Solution Part 1
- Improving Diabetes Prediction Through IQR Outlier Treatment an Evaluation of XGBoost And LightGBM Models
This work is licensed under CC BY 4.0