<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chad Austin &#187; concurrency</title>
	<atom:link href="http://chadaustin.me/tag/concurrency/feed/" rel="self" type="application/rss+xml" />
	<link>http://chadaustin.me</link>
	<description></description>
	<lastBuildDate>Mon, 07 Nov 2011 21:24:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tasks, object lifetimes, and implicit cancellation</title>
		<link>http://chadaustin.me/2008/04/tasks-object-lifetimes-and-implicit-cancellation/</link>
		<comments>http://chadaustin.me/2008/04/tasks-object-lifetimes-and-implicit-cancellation/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 12:33:00 +0000</pubDate>
		<dc:creator>Chad Austin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[tasks]]></category>

		<guid isPermaLink="false">http://aegisknight.org/new/2008/04/03/tasks-object-lifetimes-and-implicit-cancellation/</guid>
		<description><![CDATA[
Background:  The IMVU client has a system that we call the &#8216;task system&#8217; which works a lot like lightweight threads or coroutines.  You can schedule up some work which gives you back a Future object on which you can either wait or request the actual result (if it has materialized, that is).


I just [...]]]></description>
			<content:encoded><![CDATA[<p>
Background:  The IMVU client has a system that we call the &#8216;task system&#8217; which works a lot like lightweight threads or <a href="http://en.wikipedia.org/wiki/Coroutine">coroutines</a>.  You can schedule up some work which gives you back a <a href="http://en.wikipedia.org/wiki/Future_(programming)">Future</a> object on which you can either wait or request the actual result (if it has materialized, that is).
</p>

<p>I just read Joe Duffy&#8217;s <a href="http://www.bluebytesoftware.com/blog/2008/02/18/IDisposableFinalizationAndConcurrency.aspx">IDisposable, finalization, and concurrency</a>.  The parallels between TPL and IMVU&#8217;s task system surprised me.</p>

<p>When we built the task system, there were two ways to cancel execution of a task: explicit and implicit.  You could either call future.cancel() or just release your reference to the future and wait for it to be collected by the GC.  In either case, the scheduler would notice and stop running your task.  I&#8217;ve often wondered if support for implicit task cancellation was a good design.</p>

<p>After reading Joe&#8217;s article, I&#8217;m convinced.  If you believe that resource utilization is also a resource, and that implicit resource disposal (garbage collection) is the right default, then implicit cancellation is the only sane default.  In fact, we recently removed support for explicit cancellation, because we haven&#8217;t even &#8216;really&#8217; used it yet.  (Some of Dusty&#8217;s code used it, but he said it was fine to take it out.)</p>

<p>We may have to implement explicit cancellation again someday, but now I&#8217;m happy to wait until there is a compelling use case.</p>

]]></content:encoded>
			<wfw:commentRss>http://chadaustin.me/2008/04/tasks-object-lifetimes-and-implicit-cancellation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

