Could you clarify, what are these processes that 'operate as threads'? AFAIK,
Squid spawns its children by fork() and execlp(), and each new process is a
common process with its own address space. As for atomicity, the OS itself
guarantees that only one process can have an exclusive file lock at a
given time. Where do you suggest to use std::atomic then?


Eduard.

On 15.05.2017 15:04, Amos Jeffries wrote:
On 07/05/17 09:59, Eduard Bagdasaryan wrote:
This patch makes PID file check/creation atomic to avoid associated
race conditions.

I do not see any use of atomic's in this patch. Please use std::atomic locks to ensure actually atomic operations on the file locks. Squid does have some child processes operating as threads so custom implementations that don't use real atomic's will fail under some circumstances.

_______________________________________________
squid-dev mailing list
[email protected]
http://lists.squid-cache.org/listinfo/squid-dev

Reply via email to