<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Tech Off - Queue - Processing In Order</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Tech Off - Queue - Processing In Order</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Thu, 23 May 2013 11:30:33 GMT</pubDate>
	<lastBuildDate>Thu, 23 May 2013 11:30:33 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>5</c9:totalResults>
	<c9:pageCount>-5</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Tech Off - Queue - Processing In Order</title>
		<description><![CDATA[<p>Okay.&nbsp; I have a question about the method that I was going to use to process items in a queue in order.<br /><br />Let's say I have a queue, with a bunch of records, doesn't matt of what.&nbsp; The main point is that each queue, let's say, belongs to a certain account, so let's say we have an AccountID with each queue item.<br /><br />It may look like this:<br /><br />Account ID, Record<br />543, 1<br />123, 2<br />543, 3<br />543, 4<br /><br />Okay, now, the main criteria here is that I don't want to process record 4 for account id 543 before record 1 is processed for account id 543.<br /><br />Basically, to keep it simple, let's just say I'm grabbing all the records and then throwing them in a thread pool.<br /><br />Here is how I was going to do the processing:<br /><br />1) The first method I was going to do is when I'm looping through the records and throwing them in the thread pool, is on each iteration only throw in unique account id's.&nbsp; So, on the first iterationof the above data, I would only throw records 1 and 2 in.&nbsp;
 The idea is that if I grab 1000 records at a time, hopefully this will help prevent locking with the second method I use.<br /><br />2).&nbsp; The second method I use is when I go to process the record, I was going to use SyncLock thread locking method&nbsp;to grab an object for that specific account id.&nbsp; So, when the the next thread comes to process that account id, it would wait until that object
 is released.<br /><br />What do you guys think?&nbsp; Or, what is a better method?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/257405-Queue-Processing-In-Order/257405#257405</link>
		<pubDate>Tue, 04 Sep 2007 19:02:37 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/257405-Queue-Processing-In-Order/257405#257405</guid>
		<dc:creator>MetaGunny</dc:creator>
		<slash:comments>5</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/MetaGunny/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Queue - Processing In Order</title>
		<description><![CDATA[<p>I'd make a collection of collections, sorting each record into a sorted list based on the UID.&nbsp; You could use the UID as a hash to lookup the collection for the records.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/257405-Queue-Processing-In-Order/d9ca3ba472894cf591c59dfa0089e8ab#d9ca3ba472894cf591c59dfa0089e8ab</link>
		<pubDate>Tue, 04 Sep 2007 22:55:07 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/257405-Queue-Processing-In-Order/d9ca3ba472894cf591c59dfa0089e8ab#d9ca3ba472894cf591c59dfa0089e8ab</guid>
		<dc:creator>DoomBringer</dc:creator>
		<slash:comments>5</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/DoomBringer/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Queue - Processing In Order</title>
		<description><![CDATA[<p>I am not sure if I've understood your question.</p>
<p>If you have a queue and presumably that queue is built up chronologically, why would record 1 ever get processed after record 4?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/257405-Queue-Processing-In-Order/2ef80f1389a84fa2b2779dfa0089e91d#2ef80f1389a84fa2b2779dfa0089e91d</link>
		<pubDate>Wed, 05 Sep 2007 16:29:42 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/257405-Queue-Processing-In-Order/2ef80f1389a84fa2b2779dfa0089e91d#2ef80f1389a84fa2b2779dfa0089e91d</guid>
		<dc:creator>zhuo</dc:creator>
		<slash:comments>5</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/zhuo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Queue - Processing In Order</title>
		<description><![CDATA[<p><blockquote>
<div class="quoteAuthor">zhuo wrote:</div>
<div class="quoteBody">&#65279;
<p>I am not sure if I've understood your question.</p>
<p>If you have a queue and presumably that queue is built up chronologically, why would record 1 ever get processed after record 4?</p>
</div>
</blockquote>
<br />I think he wants to separate the records by user ID so a single thread can handle a single user ID, and he wants to preserve the ordering.&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/257405-Queue-Processing-In-Order/f6c540d65d21494e8fd69dfa0089e965#f6c540d65d21494e8fd69dfa0089e965</link>
		<pubDate>Wed, 05 Sep 2007 23:14:52 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/257405-Queue-Processing-In-Order/f6c540d65d21494e8fd69dfa0089e965#f6c540d65d21494e8fd69dfa0089e965</guid>
		<dc:creator>DoomBringer</dc:creator>
		<slash:comments>5</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/DoomBringer/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Queue - Processing In Order</title>
		<description><![CDATA[<p>Thanks Doom.&nbsp; I'll give that a try.&nbsp; The only problem some what is I don't know the user id in the beginning but have to do some processing as well to get that.<br /><br />They could process out of order because I'm not doing the processing on a single thread, sequentially.&nbsp;&nbsp; I process through each and throw it into a thread pool</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/257405-Queue-Processing-In-Order/cebb09120f6b4a7889219dfa0089e9b0#cebb09120f6b4a7889219dfa0089e9b0</link>
		<pubDate>Thu, 06 Sep 2007 00:23:41 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/257405-Queue-Processing-In-Order/cebb09120f6b4a7889219dfa0089e9b0#cebb09120f6b4a7889219dfa0089e9b0</guid>
		<dc:creator>MetaGunny</dc:creator>
		<slash:comments>5</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/MetaGunny/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>