<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Copy-On-Write 101 &#8211; Part 2: Putting It to Use</title> <atom:link href="http://hackerboss.com/copy-on-write-101-part-2-putting-it-to-use/feed/" rel="self" type="application/rss+xml" /><link>http://hackerboss.com/copy-on-write-101-part-2-putting-it-to-use/</link> <description>Developing software and managing development teams.</description> <lastBuildDate>Sun, 08 Aug 2010 20:15:47 +0000</lastBuildDate> <generator>http://wordpress.org/?v=</generator> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>By: Ville Laurikari</title><link>http://hackerboss.com/copy-on-write-101-part-2-putting-it-to-use/comment-page-1/#comment-1374</link> <dc:creator>Ville Laurikari</dc:creator> <pubDate>Wed, 05 May 2010 19:55:03 +0000</pubDate> <guid
isPermaLink="false">http://hackerboss.com/?p=473#comment-1374</guid> <description>Phew, that&#039;s a lot of requirements.O(1) reads and O(1) updates already rule out COW structures, in theory.  COW structures are necessarily trees, and the best you can do is O(log N).  In practice, though, especially as you expect to only keep about a 1000 mappings, you can use a tree with a very high branching factor (branching by 10 you get to leaf nodes in 3 hops, branching by 32 with 2 hops).For only a 1000 mappings, constant factors will definitely be your most important concern.Multithreaded and lockless spells STM to me.  That means no blocking, but updates may fail and you need to retry.But really, &quot;best&quot; can mean many different things.  If absolute speed is what you want, your best bet may be to implement your own hash table tree. You can hand tune it for your particular application and key space, and possibly take some shortcuts that a generic data structure cannot.If you want to use existing libraries, why not just try a handful and benchmark them all?  I&#039;d be interested to see the results :)</description> <content:encoded><![CDATA[<p>Phew, that&#8217;s a lot of requirements.</p><p>O(1) reads and O(1) updates already rule out COW structures, in theory.  COW structures are necessarily trees, and the best you can do is O(log N).  In practice, though, especially as you expect to only keep about a 1000 mappings, you can use a tree with a very high branching factor (branching by 10 you get to leaf nodes in 3 hops, branching by 32 with 2 hops).</p><p>For only a 1000 mappings, constant factors will definitely be your most important concern.</p><p>Multithreaded and lockless spells STM to me.  That means no blocking, but updates may fail and you need to retry.</p><p>But really, &#8220;best&#8221; can mean many different things.  If absolute speed is what you want, your best bet may be to implement your own hash table tree. You can hand tune it for your particular application and key space, and possibly take some shortcuts that a generic data structure cannot.</p><p>If you want to use existing libraries, why not just try a handful and benchmark them all?  I&#8217;d be interested to see the results :)</p> ]]></content:encoded> </item> <item><title>By: Blaisorblade</title><link>http://hackerboss.com/copy-on-write-101-part-2-putting-it-to-use/comment-page-1/#comment-1348</link> <dc:creator>Blaisorblade</dc:creator> <pubDate>Mon, 03 May 2010 17:22:46 +0000</pubDate> <guid
isPermaLink="false">http://hackerboss.com/?p=473#comment-1348</guid> <description>OK, I&#039;ve been thinking about using copy-on-write for a shared dictionary (which has probably infrequent updates). My first guess was to use a multi-level hash table, then someone mentioned me Clojure and its log_32(n) hash table trees. Can you suggest me what&#039;s the best algorithm to use?My requirements are:
- O(1) reads (in practice)
- O(1) changes to existing mappings.
- fast structural updates, especially before the moment the structure is shared
- low constant factors (this is maybe even more important than scalability; I may be wrong, but I don&#039;t expect more than 1000 mappings to be present).
- multithreaded and lockless (well, memory barriers are needed, even if you don&#039;t mention them)
Persistence is &lt;em&gt;not&lt;/em&gt; a functional requirement, just an implementation detail of this idea.Then, I was looking also at Java&#039;s ConcurrentHashMap (which is just partially COW under the hood, but not fully) and Cliff&#039;s Click NonblockingConcurrentHashMap (http://sourceforge.net/projects/high-scale-lib, http://www.azulsystems.com/events/javaone_2008/2008_CodingNonBlock.pdf).What&#039;s your suggestion?</description> <content:encoded><![CDATA[<p>OK, I&#8217;ve been thinking about using copy-on-write for a shared dictionary (which has probably infrequent updates). My first guess was to use a multi-level hash table, then someone mentioned me Clojure and its log_32(n) hash table trees. Can you suggest me what&#8217;s the best algorithm to use?</p><p>My requirements are:<br
/> - O(1) reads (in practice)<br
/> - O(1) changes to existing mappings.<br
/> - fast structural updates, especially before the moment the structure is shared<br
/> - low constant factors (this is maybe even more important than scalability; I may be wrong, but I don&#8217;t expect more than 1000 mappings to be present).<br
/> - multithreaded and lockless (well, memory barriers are needed, even if you don&#8217;t mention them)<br
/> Persistence is <em>not</em> a functional requirement, just an implementation detail of this idea.</p><p>Then, I was looking also at Java&#8217;s ConcurrentHashMap (which is just partially COW under the hood, but not fully) and Cliff&#8217;s Click NonblockingConcurrentHashMap (<a
href="http://sourceforge.net/projects/high-scale-lib" rel="nofollow">http://sourceforge.net/projects/high-scale-lib</a>, <a
href="http://www.azulsystems.com/events/javaone_2008/2008_CodingNonBlock.pdf)" rel="nofollow">http://www.azulsystems.com/events/javaone_2008/2008_CodingNonBlock.pdf)</a>.</p><p>What&#8217;s your suggestion?</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 1/8 queries in 0.027 seconds using disk

Served from: hackerboss.com @ 2010-09-05 20:16:46 -->