<div dir="ltr"><div><div>I'd like to hash this out a bit further. As this issue affects <font face="courier new, monospace">vector</font> primarily, it is outside of the scope of the core library committee per se, and is largely up to Roman as the maintainer of <font face="courier new, monospace">vector</font>.</div>
</div><div><br></div><div>That said if I put on my personal and not my 'committee' hat:</div><div><br></div>I would use these operations, personally, were they available to me.<div><br></div><div>The question is how to best expose them from an API perspective. </div>
<div><br></div><div>Vector currently exposes enough (or at least almost enough) of the implementation details that such support could be implemented 'out-of-line' from the main library. (I think the Data.Vector.Primitive constructor is currently not exported, and you'd need that.)<div>
<br></div><div>I don't <i>think</i> Roman would object too strenuously to exporting it though and I've personally wanted it for other reasons. This would open the door to this sort of thing being something you might supply entirely outside of the library, giving the final placement of the code some flexibility.</div>
</div><div><br></div><div>You could handle CAS operations for Primitive and boxed Vectors pretty easily at least, leaving off Unboxed and my various hybrid vector approaches as they are intrinsically tied to working on multiple underlying source vectors.</div>
<div><br></div><div>I'm pretty open to ideas about where the instances should live though. One argument for putting it in vector is you could extend Prim with the CAS operations directly rather than subclass it. An argument against is it could then iterate on a more flexible time table.</div>
<div><br></div><div>-Edward</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 21, 2013 at 10:30 AM, Ryan Newton <span dir="ltr"><<a href="mailto:rrnewton@gmail.com" target="_blank">rrnewton@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">[Popping up to the big-picture question for a moment, from the previous thread on Vector CAS.]<div><br></div>
<div><div>Given that a lot of people are really advertising Haskell on the parallel/concurrent front, it seems like we <i>should</i> be committed as a community to making our basic libraries support parallel/concurrent use cases effectively.  This will necessarily mean touching some core libraries (container, vector...).</div>


<div><br></div><div>The two things that have come up for me recently are (1) CAS/RMW on [unboxed] Vectors and a general notion of balanced-splitting for tree-based structures (Map,Set).  But I'm sure there are others!</div>


<div><br></div><div>Is any one else invested in getting this kind of thing moving?  It would be great to have a partner.  I can commit a small amount of cycles, but I don't have lots of bandwidth for non-research infrastructure work presently.  Edward, is any of this useful to you?  </div>


<div><br></div><div>In many of these cases it seems like the main problem is not a technical one, but the social one of consensus building (and fighting excessive "stop energy" if it appears).  Edward, as chair of the core libraries committee, maybe you could help with this?</div>


<div><br></div><div>Cheers,</div><div>  -Ryan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 21, 2013 at 10:25 AM, Ryan Newton <span dir="ltr"><<a href="mailto:rrnewton@gmail.com" target="_blank">rrnewton@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">[@Aleksey] Very good point!  I'd missed that vector does the SOA->AOS business too.  (I thought that was just Repa & Accelerate.)<div>


<br></div><div>In any case, an unboxed vector of tuples can't <b>actually</b> support atomic CAS anyway, so not supporting it is inevitable.</div>
<div>   It does mean that exposeMutableByteArray can't be a method of the Unbox class.  It would need to be another class capturing the subset of vector types that are "Atomic" (support concurrent/atomic memory ops).</div>



<div><br></div><div><br></div><div><br></div></div>
</blockquote></div><br></div></div>
</blockquote></div><br></div>