﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Dale Newman commented on Rhino ETL Union Operation</title><description>I want to thank Ayende and the folks that commented on this blog post.  I ended up using Vladimir's version in my SQLoogle project, and it works great!

If you're interested in Rhino ETL at all, I just finished an article on CodeProject about SQLoogle, which is mainly about using Ayende's Rhino ETL.  It's here: 

http://www.codeproject.com/Articles/573937/SQLoogle-Part-1-of-2

Thanks again :-)</description><link>http://ayende.com/160962/rhino-etl-union-operation#comment6</link><guid>http://ayende.com/160962/rhino-etl-union-operation#comment6</guid><pubDate>Thu, 16 May 2013 14:27:05 GMT</pubDate></item><item><title>Whut commented on Rhino ETL Union Operation</title><description>I believe that this null helps when there are no rows returned by currentOp, but still race condition is there. Add something like if (currentOp.Name == "MarkerOperation") { Thread.Sleep(TimeSpan.FromSeconds(5)); } after blockingCollection.Add(null) to have it visible.</description><link>http://ayende.com/160962/rhino-etl-union-operation#comment5</link><guid>http://ayende.com/160962/rhino-etl-union-operation#comment5</guid><pubDate>Mon, 18 Feb 2013 13:20:26 GMT</pubDate></item><item><title>Ayende Rahien commented on Rhino ETL Union Operation</title><description>Whut,
The whole point of the null is to avoid the race condition.
Either all the tasks are done, in which case you'll have a null (freeing you from the Take()), or not.</description><link>http://ayende.com/160962/rhino-etl-union-operation#comment4</link><guid>http://ayende.com/160962/rhino-etl-union-operation#comment4</guid><pubDate>Mon, 18 Feb 2013 13:04:38 GMT</pubDate></item><item><title>Whut commented on Rhino ETL Union Operation</title><description>Clever and simple code.

But I don't understand what is the purpose of: "blockingCollection.Add(null); // free the consumer thread"? Could someone explain?

Also, isn't there a race condition in the first while loop? Imagine last task that added all rows but not yet finished. In the mean time main thread consumes all rows. At this point check tasks.All(x =&gt; x.IsFaulted || x.IsCanceled || x.IsCompleted) will return false, but since there will be no new rows added, call to blockingCollection.Take() will block forever.</description><link>http://ayende.com/160962/rhino-etl-union-operation#comment3</link><guid>http://ayende.com/160962/rhino-etl-union-operation#comment3</guid><pubDate>Mon, 18 Feb 2013 12:52:39 GMT</pubDate></item><item><title>Vladimir commented on Rhino ETL Union Operation</title><description>Kinda stupid question, why not use GetConsumingEnumerable() + CompleteAdding, like this (https://gist.github.com/v2m/4969559). </description><link>http://ayende.com/160962/rhino-etl-union-operation#comment2</link><guid>http://ayende.com/160962/rhino-etl-union-operation#comment2</guid><pubDate>Sun, 17 Feb 2013 01:17:25 GMT</pubDate></item><item><title>Rémi BOURGAREL commented on Rhino ETL Union Operation</title><description>Isn't it the purpose of parrallel linq ?</description><link>http://ayende.com/160962/rhino-etl-union-operation#comment1</link><guid>http://ayende.com/160962/rhino-etl-union-operation#comment1</guid><pubDate>Fri, 15 Feb 2013 10:56:33 GMT</pubDate></item></channel></rss>