<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body smarttemplateinserted="true" text="#000000" bgcolor="#FFFFFF">
<div id="smartTemplate4-template">Hi Fpc Developers',<br>
<br>
<p> </p>
<blockquote type="cite">Nobody is talking about the string
content. </blockquote>
<p><br>
</p>
<p>But when they are stored together, that is the same. You can't
get one without the other.<br>
</p>
<p><br>
</p>
<p>When core A creates a string to pass to core B, core A writes
three things: ref count 1, the string content and the
incremented ref count 2. <br>
</p>
<p>If core B could see stale data after the second write (with ref
count 1), it could also see stale data after the first write
(without content). Nothing changes on core B between the writes.<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<blockquote type="cite">It's only about the reference count right
now and that one *can* differ between cores if that isn't
correctly handled (even if the string content stays the same). </blockquote>
<br>
</div>
<div>Sure one core can read 2 after the other core wrote 1.</div>
<div><br>
</div>
<div>I do not see how a core can read 1 after a 2 was written. <br>
</div>
<div><br>
Cheers,<br>
Benito </div>
<br>
<div class="moz-cite-prefix">Am 03.01.19 um 14:23 schrieb Sven Barth
via fpc-devel:<br>
</div>
<blockquote type="cite"
cite="mid:CAFMUeB_2E4jqYTQ6iuPx1C76J8ZB=ivTCkN3-CfwJ_+C1TWxZQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">
<div>
<div class="gmail_quote">
<div dir="ltr">Am Do., 3. Jan. 2019, 13:25 hat Benito van
der Zander <<a href="mailto:benito@benibela.de"
moz-do-not-send="true">benito@benibela.de</a>>
geschrieben:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0
0

 .8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div>
<div id="m_1978264264517136581smartTemplate4-template">Hi,<br>
<br>
<p> </p>
<blockquote type="cite"><br>
<br>
The issue I was talking about is the fact that
atomic operations do function as global memory
synchronisation operations across all cores (at
least not on all architectures). If core 1
atomatically increases refcount to two and you
"then" load the same refcount normally (without an
atomic read-modify-exchange oepration) on another
core, this other core may still see the old value. </blockquote>
</div>
<div><br>
</div>
<div>Is that really so? <br>
</div>
<div><br>
</div>
<div>The ref count is stored in the same memory block as
the string itself.<br>
</div>
<div><br>
</div>
<div>If core 2 could not see the new ref count, it could
not see what is in the string and thus not use the
string for anything . </div>
</div>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Nobody is talking about the string content. It's
only about the reference count right now and that one *can*
differ between cores if that isn't correctly handled (even if
the string content stays the same). </div>
<div dir="auto"><br>
</div>
<div dir="auto">Regards, </div>
<div dir="auto">Sven </div>
<div dir="auto">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0
0

 .8ex;border-left:1px #ccc
solid;padding-left:1ex"> </blockquote>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
fpc-devel maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>
</pre>
</blockquote>
</body>
</html>