<p dir="ltr" style="margin-top:0; margin-bottom:0;">Hi, </p>
<p dir="ltr" style="margin-top:0; margin-bottom:0;">What I understand is that atomicity will serialize any call to this function. If you have only calls to this function, I'm not sure locking scheme will have an impact. </p>
<p dir="ltr" style="margin-top:0; margin-bottom:0;">OTP team may give more clues on this. </p>
<p dir="ltr" style="margin-top:0; margin-bottom:0;">But if you want to be sure, benchmark? </p>
<p dir="ltr" style="margin-top:0; margin-bottom:0;">I'm curious with the results. </p>
<br>
<p dir="ltr" style="margin-top:0; margin-bottom:0;">Envoyé depuis mon mobile </p><br><br>---- Frank Muller a écrit ----<br><br><div dir="auto">Hi Eric,</div><div dir="auto"><br></div><div dir="auto">Do you mean that “read_concurrency | write_concurrency” options don’t matter in my case ?</div><div dir="auto"><br></div><div dir="auto">My original question was how to set them for best performances.</div><div dir="auto"><br></div><div dir="auto">/Frank</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">24 nov. 2020 22:21, Eric Pailleau <<a href="mailto:eric.pailleau@wanadoo.fr">eric.pailleau@wanadoo.fr</a>> wrote :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><p dir="ltr" style="margin-top:0px;margin-bottom:0px">Hi, </p>
<p dir="ltr" style="margin-top:0px;margin-bottom:0px">Documentation says that operation is guaranteed to be <a href="https://erlang.org/doc/man/ets.html#concurrency" target="_blank">atomic and isolated</a>. </p>
<br>
<p dir="ltr" style="margin-top:0px;margin-bottom:0px">Envoyé depuis mon mobile </p><br><br>---- Frank Muller a écrit ----<br><br><div dir="auto">Hi guys,</div><div dir="auto"><br></div><div dir="auto">I've a ETS (type of "set") which contains ONLY counters (ets:update_counter/3).</div><div dir="auto"><br></div><div dir="auto">This table is heavily used and the counters get incremented and decremented at different rates.</div><div dir="auto"><br></div><div dir="auto">Question: how should i set my table?</div><div dir="auto">1. both concurrency set to true:</div><div dir="auto"> [ set</div><div dir="auto"> , {read_concurrency, true}</div><div dir="auto"> , {write_concurrency, true} ].</div><div dir="auto"><br></div><div dir="auto">2. only read concurrency set to true:</div><div dir="auto"> [ set</div><div dir="auto"> , {read_concurrency, true}</div><div dir="auto"> , {write_concurrency, false} ].</div><div dir="auto"><br></div><div dir="auto">3. only write concurrency set to true:</div><div dir="auto"> [ set</div><div dir="auto"> , {read_concurrency, false}</div><div dir="auto"> , {write_concurrency, true} ].</div><div dir="auto"><br></div><div dir="auto">Please explain why?</div><div dir="auto"><br></div><div dir="auto">/Frank</div>
</blockquote></div></div>