<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Table option {write_concurrency, true} can only reduce lock
contention<br>
when you got concurrent write operations toward *different* keys<br>
within the same table.<br>
<br>
Write operations towards one specific table object is always
serialized<br>
with locking.<br>
<br>
<br>
/Sverker, Erlang/OTP<br>
<br>
<br>
<div class="moz-cite-prefix">On 06/09/2017 07:44 AM, Frank Muller
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAFA6GnAnC_3w=9bso_+YGAT4ELTGqyTrKJgrAv2PfsrzWnV3hA@mail.gmail.com">
<pre wrap="">Hi Everyone,
I've some troubles to understand the optimal settings for this little
simple problem:
Two Erlang processes A and B.
1. Process A randomly increments a counter during its lifetime using "ets
:update_counter/3"
2. Process B reads the counter every X seconds and reset it to 0.
I decided to use these options when creating the table:
{write_concurrency, true}, %% A and B
{read_concurrency, false} %% only B
Are these settings correct and more importantly "optimal" (please elaborate
your answer)?
/Frank
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
<br>
</body>
</html>