<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Could you clarify, what are these processes that 'operate as
threads'? AFAIK,<br>
Squid spawns its children by fork() and execlp(), and each new
process is a<br>
common process with its own address space. As for atomicity, the OS
itself<br>
guarantees that only one process can have an exclusive file lock at
a<br>
given time. Where do you suggest to use std::atomic then?<br>
<br>
<br>
Eduard.<br>
<br>
<div class="moz-cite-prefix">On 15.05.2017 15:04, Amos Jeffries
wrote:<br>
</div>
<blockquote
cite="mid:ba0ca3d9-646b-b3d2-3e32-336401a8cefb@treenet.co.nz"
type="cite">On 07/05/17 09:59, Eduard Bagdasaryan wrote:
<br>
<blockquote type="cite" style="color: #000000;">This patch makes
PID file check/creation atomic to avoid associated
<br>
race conditions.
<br>
</blockquote>
<br>
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.
<br>
</blockquote>
<br>
</body>
</html>