<div dir="ltr">cas in ghc has sequential semantics. <div><br></div><div style>i'm not sure if every use of it needs that semantics, if you identify examples where weaker operations may suffice, please share!</div></div>

<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Dec 5, 2013 at 2:58 AM, KwangYul Seo <span dir="ltr"><<a href="mailto:kwangyul.seo@gmail.com" target="_blank">kwangyul.seo@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>java.util.concurrent.atomic package provides two flavors of compare and set operations: compareAndSet and weakCompareAndSet. The latter does not create any happens-before orderings, so we can use it where no guarantees with respect to previous or subsequent reads and writes of any variables other than the target of the weakCompareAndSet are required.</div>


<div><br></div><div>I'd like to ask if the compare-and-swap function provided by GHC runtime (cas() in includes/stg/SMP.h) is strong or weak. If it is strong, do all use cases of cas() require this semantics?</div><div>


<br></div><div>Regards,</div><div>Kwang Yul Seo</div><div><br></div></div>
<br>_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-devs</a><br>
<br></blockquote></div><br></div>