CodeIgniter Forums
Make Session Lock type Configurable - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forum-6.html)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forum-17.html)
+--- Thread: Make Session Lock type Configurable (/thread-71759.html)



Make Session Lock type Configurable - Stretch - 09-19-2018

Hi,

I'm curious why the Session_files_driver::read() method exclusively uses LOCK_EX when obtaining a file lock? This tends to cause ajax requests to get blocked and process in succession rather than in parallel. It seems allowing read requests to use LOCK_SH and write requests to use LOCK_EX would be a more efficient solution, or perhaps make the lock type configurable. Perhaps I'm missing something.