<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Announcing split-channel</title>
	<atom:link href="http://blog.melding-monads.com/2012/07/10/announcing-split-channel/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.melding-monads.com/2012/07/10/announcing-split-channel/</link>
	<description>Math, Computer Science,  and Education</description>
	<lastBuildDate>Wed, 08 May 2013 14:59:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: lpsmith</title>
		<link>http://blog.melding-monads.com/2012/07/10/announcing-split-channel/#comment-259</link>
		<dc:creator><![CDATA[lpsmith]]></dc:creator>
		<pubDate>Thu, 19 Jul 2012 18:34:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.melding-monads.com/?p=491#comment-259</guid>
		<description><![CDATA[Yeah,  I&#039;m not too surprised that GHC manages to optimize Chan&#039;s ReceivePort away in this simple benchmark.   And it may well do so in more realistic use cases too.  You may find it enlightening to study GHC&#039;s core output,  and probe some of the limitations of the set of optimizations that accomplishes this.]]></description>
		<content:encoded><![CDATA[<p>Yeah,  I&#8217;m not too surprised that GHC manages to optimize Chan&#8217;s ReceivePort away in this simple benchmark.   And it may well do so in more realistic use cases too.  You may find it enlightening to study GHC&#8217;s core output,  and probe some of the limitations of the set of optimizations that accomplishes this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jberryman</title>
		<link>http://blog.melding-monads.com/2012/07/10/announcing-split-channel/#comment-258</link>
		<dc:creator><![CDATA[jberryman]]></dc:creator>
		<pubDate>Thu, 19 Jul 2012 13:54:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.melding-monads.com/?p=491#comment-258</guid>
		<description><![CDATA[Right, I think the relevant optimization is just inlining/unfolding where the compiler sees it doesn&#039;t have to rebox the two MVars in the Chan constructor, but I&#039;m not sure.

The code I used was (sorry if this doesn&#039;t get formatted correctly):

&lt;pre&gt;
module Main
    where

import Control.Concurrent.Chan
import Control.Concurrent.Chan.Split

main = main1

payload :: [Integer]
payload = [1000000000000000.. 1000000010000000]

-- test traditional Chan implementation:
main0 = do
    putStrLn &quot;Starting to write&quot;
    s &lt;- newChan
    mapM_ (writeChan s) payload
    putStrLn &quot;Done&quot;

main1 = do
    putStrLn &quot;Starting to write&quot;
    s &lt;- newSendPort
    mapM_ (send s) payload
    putStrLn &quot;Done&quot;
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Right, I think the relevant optimization is just inlining/unfolding where the compiler sees it doesn&#8217;t have to rebox the two MVars in the Chan constructor, but I&#8217;m not sure.</p>
<p>The code I used was (sorry if this doesn&#8217;t get formatted correctly):</p>
<pre>
module Main
    where

import Control.Concurrent.Chan
import Control.Concurrent.Chan.Split

main = main1

payload :: [Integer]
payload = [1000000000000000.. 1000000010000000]

-- test traditional Chan implementation:
main0 = do
    putStrLn "Starting to write"
    s &lt;- newChan
    mapM_ (writeChan s) payload
    putStrLn &quot;Done&quot;

main1 = do
    putStrLn &quot;Starting to write&quot;
    s &lt;- newSendPort
    mapM_ (send s) payload
    putStrLn &quot;Done&quot;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: lpsmith</title>
		<link>http://blog.melding-monads.com/2012/07/10/announcing-split-channel/#comment-256</link>
		<dc:creator><![CDATA[lpsmith]]></dc:creator>
		<pubDate>Thu, 19 Jul 2012 05:26:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.melding-monads.com/?p=491#comment-256</guid>
		<description><![CDATA[[Re:   jberryman&#039;s question about  GC benchmarks]

No, I haven&#039;t benchmarked.   I find that surprising,  but only a little bit.  (I&#039;m not surprised by being surprised at GHC optimizations.)    It&#039;s probably better to not rely on this particular optimization though,  unless it&#039;s a particularly well-understood and reliable optimization.  I would expect it to be relatively easy to come up with use cases where the optimization doesn&#039;t kick in,  for reasons that may be less than immediately obvious.    

I&#039;m very interested in seeing your benchmark, though.]]></description>
		<content:encoded><![CDATA[<p>[Re:   jberryman's question about  GC benchmarks]</p>
<p>No, I haven&#8217;t benchmarked.   I find that surprising,  but only a little bit.  (I&#8217;m not surprised by being surprised at GHC optimizations.)    It&#8217;s probably better to not rely on this particular optimization though,  unless it&#8217;s a particularly well-understood and reliable optimization.  I would expect it to be relatively easy to come up with use cases where the optimization doesn&#8217;t kick in,  for reasons that may be less than immediately obvious.    </p>
<p>I&#8217;m very interested in seeing your benchmark, though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jberryman</title>
		<link>http://blog.melding-monads.com/2012/07/10/announcing-split-channel/#comment-255</link>
		<dc:creator><![CDATA[jberryman]]></dc:creator>
		<pubDate>Wed, 18 Jul 2012 23:34:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.melding-monads.com/?p=491#comment-255</guid>
		<description><![CDATA[Do you have any benchmarks that you&#039;re using to measure GC behavior vs Chan? In all of my simple tests of vanilla Chan (on GHC 7.4.1), unless optimizations are turned completely off, messages are successfully garbage collected as we write, when there are no more readers (i.e. no more references to the fst / read side of the Chan).

I certainly see the benefit to making it easier for the GC to do its duties, but I&#039;m wondering if there are any cases where you&#039;ve seen your implementation have better behavior then straight Chan with optimizations on.]]></description>
		<content:encoded><![CDATA[<p>Do you have any benchmarks that you&#8217;re using to measure GC behavior vs Chan? In all of my simple tests of vanilla Chan (on GHC 7.4.1), unless optimizations are turned completely off, messages are successfully garbage collected as we write, when there are no more readers (i.e. no more references to the fst / read side of the Chan).</p>
<p>I certainly see the benefit to making it easier for the GC to do its duties, but I&#8217;m wondering if there are any cases where you&#8217;ve seen your implementation have better behavior then straight Chan with optimizations on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jberryman</title>
		<link>http://blog.melding-monads.com/2012/07/10/announcing-split-channel/#comment-248</link>
		<dc:creator><![CDATA[jberryman]]></dc:creator>
		<pubDate>Sat, 14 Jul 2012 20:27:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.melding-monads.com/?p=491#comment-248</guid>
		<description><![CDATA[Ah, I think I was confusing things. I&#039;ll have to take some time to wrap my bony head around the details and might steal your approach for my own library.]]></description>
		<content:encoded><![CDATA[<p>Ah, I think I was confusing things. I&#8217;ll have to take some time to wrap my bony head around the details and might steal your approach for my own library.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lpsmith</title>
		<link>http://blog.melding-monads.com/2012/07/10/announcing-split-channel/#comment-247</link>
		<dc:creator><![CDATA[lpsmith]]></dc:creator>
		<pubDate>Fri, 13 Jul 2012 18:57:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.melding-monads.com/?p=491#comment-247</guid>
		<description><![CDATA[Well, same semantics,  just wrapped up in a slightly different interface.   The module name clash between our packages is somewhat unfortunate, I agree,  but I doubt that it&#039;ll be a problem, and I don&#039;t really want to add any dependencies other than base.

Regarding &lt;code&gt;listen&lt;/code&gt; and race conditions,  I don&#039;t think it&#039;s going to be especially problematic compared to any other concurrent operator.    I would reemphasize that &lt;code&gt;listen&lt;/code&gt; is the equivalent of &lt;code&gt;dupChan&lt;/code&gt;,  so you can create the exact same problems as you can with &lt;code&gt;Chan&lt;/code&gt;.  And I think it enhances the potential advantage of having zero &lt;code&gt;ReceivePorts&lt;/code&gt;,  otherwise this situation is a lot less useful,  in my opinion.   I mean,  the program that initially motivated this library required the use of listen. 

I would point out that that the &quot;zero receive ports&quot; is something of a special situation, that the real advantage is the finer-grained types.   I&#039;ve only found one use for that situation,  which is my fork of the pgsql-simple library,   and that code was only in production for a couple of months before being replaced with the postgresql-simple library.    And even then, the motivation was providing pgsql-simple with some desirable properties; the client of that library didn&#039;t actually make use of those particular properties.

If not for the fact that I really like having SendPorts seperate from ReceivePorts,  I probably wouldn&#039;t still be using this library in other projects,  and probably wouldn&#039;t have released it on hackage.]]></description>
		<content:encoded><![CDATA[<p>Well, same semantics,  just wrapped up in a slightly different interface.   The module name clash between our packages is somewhat unfortunate, I agree,  but I doubt that it&#8217;ll be a problem, and I don&#8217;t really want to add any dependencies other than base.</p>
<p>Regarding <code>listen</code> and race conditions,  I don&#8217;t think it&#8217;s going to be especially problematic compared to any other concurrent operator.    I would reemphasize that <code>listen</code> is the equivalent of <code>dupChan</code>,  so you can create the exact same problems as you can with <code>Chan</code>.  And I think it enhances the potential advantage of having zero <code>ReceivePorts</code>,  otherwise this situation is a lot less useful,  in my opinion.   I mean,  the program that initially motivated this library required the use of listen. </p>
<p>I would point out that that the &#8220;zero receive ports&#8221; is something of a special situation, that the real advantage is the finer-grained types.   I&#8217;ve only found one use for that situation,  which is my fork of the pgsql-simple library,   and that code was only in production for a couple of months before being replaced with the postgresql-simple library.    And even then, the motivation was providing pgsql-simple with some desirable properties; the client of that library didn&#8217;t actually make use of those particular properties.</p>
<p>If not for the fact that I really like having SendPorts seperate from ReceivePorts,  I probably wouldn&#8217;t still be using this library in other projects,  and probably wouldn&#8217;t have released it on hackage.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jberryman</title>
		<link>http://blog.melding-monads.com/2012/07/10/announcing-split-channel/#comment-246</link>
		<dc:creator><![CDATA[jberryman]]></dc:creator>
		<pubDate>Thu, 12 Jul 2012 21:50:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.melding-monads.com/?p=491#comment-246</guid>
		<description><![CDATA[Yes, I remember being surprised that Chans were implemented so simply with MVar. Your lib has quite different semantics and warrants a new implementation, but the naming clash is unfortunate. Do you have any interest in providing an instance for my SplitChan class? 

A couple questions: doesn&#039;t the existence of &#039;listen&#039; weaken your advantage no. 1, since we can always get a receive port from a SendPort? won&#039;t it be difficult to use &#039;listen&#039; effectively (i.e. without throwing messages &quot;into the aether&quot; non-deterministically) in real concurrent code?]]></description>
		<content:encoded><![CDATA[<p>Yes, I remember being surprised that Chans were implemented so simply with MVar. Your lib has quite different semantics and warrants a new implementation, but the naming clash is unfortunate. Do you have any interest in providing an instance for my SplitChan class? </p>
<p>A couple questions: doesn&#8217;t the existence of &#8216;listen&#8217; weaken your advantage no. 1, since we can always get a receive port from a SendPort? won&#8217;t it be difficult to use &#8216;listen&#8217; effectively (i.e. without throwing messages &#8220;into the aether&#8221; non-deterministically) in real concurrent code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lpsmith</title>
		<link>http://blog.melding-monads.com/2012/07/10/announcing-split-channel/#comment-245</link>
		<dc:creator><![CDATA[lpsmith]]></dc:creator>
		<pubDate>Thu, 12 Jul 2012 14:51:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.melding-monads.com/?p=491#comment-245</guid>
		<description><![CDATA[I did see your library, actually, but only after I&#039;d released mine.   The key is that I didn&#039;t build a wrapper around Control.Concurrent.Chan,  I reimplemented the idea.  (It&#039;s a very simple idea and implementation, by the way.  Did you ever look at the source, or read the Concurrent Haskell paper?) 

The problem is that a Chan is basically a pair consisting of a SendPort and ReceivePort,  so an active channel necessarily has a reference to at least one ReceivePort.   Thus messages will build up in that channel if somebody is talking and nobody is listening.   So I got rid of that pair and made a few other small improvements.

You can take a look at the &lt;a href=&quot;http://github.com/lpsmith/split-channel&quot; rel=&quot;nofollow&quot;&gt;github repo&lt;/a&gt; if you are impatient.]]></description>
		<content:encoded><![CDATA[<p>I did see your library, actually, but only after I&#8217;d released mine.   The key is that I didn&#8217;t build a wrapper around Control.Concurrent.Chan,  I reimplemented the idea.  (It&#8217;s a very simple idea and implementation, by the way.  Did you ever look at the source, or read the Concurrent Haskell paper?) </p>
<p>The problem is that a Chan is basically a pair consisting of a SendPort and ReceivePort,  so an active channel necessarily has a reference to at least one ReceivePort.   Thus messages will build up in that channel if somebody is talking and nobody is listening.   So I got rid of that pair and made a few other small improvements.</p>
<p>You can take a look at the <a href="http://github.com/lpsmith/split-channel" rel="nofollow">github repo</a> if you are impatient.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jberryman</title>
		<link>http://blog.melding-monads.com/2012/07/10/announcing-split-channel/#comment-244</link>
		<dc:creator><![CDATA[jberryman]]></dc:creator>
		<pubDate>Thu, 12 Jul 2012 13:38:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.melding-monads.com/?p=491#comment-244</guid>
		<description><![CDATA[I can&#039;t look at your lib right now since hackage appears to be down, but did you see my library &#039;chan-split&#039;? I&#039;m interested in seeing what you&#039;ve done (especially curious how you managed to let the GC collect chan receive ends)]]></description>
		<content:encoded><![CDATA[<p>I can&#8217;t look at your lib right now since hackage appears to be down, but did you see my library &#8216;chan-split&#8217;? I&#8217;m interested in seeing what you&#8217;ve done (especially curious how you managed to let the GC collect chan receive ends)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lpsmith</title>
		<link>http://blog.melding-monads.com/2012/07/10/announcing-split-channel/#comment-241</link>
		<dc:creator><![CDATA[lpsmith]]></dc:creator>
		<pubDate>Wed, 11 Jul 2012 15:39:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.melding-monads.com/?p=491#comment-241</guid>
		<description><![CDATA[I hadn&#039;t heard of Levien&#039;s Io before, thanks!   Hope your project goes well.]]></description>
		<content:encoded><![CDATA[<p>I hadn&#8217;t heard of Levien&#8217;s Io before, thanks!   Hope your project goes well.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
