<?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>Dylan&#039;s Journal &#187; misc</title>
	<atom:link href="http://dylan.hardison.net/journal/category/misc/feed/" rel="self" type="application/rss+xml" />
	<link>http://dylan.hardison.net/journal</link>
	<description>A collection of unrelated sentences.</description>
	<lastBuildDate>Wed, 02 Nov 2011 13:53:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Thread-safe DNS requests</title>
		<link>http://dylan.hardison.net/journal/2007/11/02/thread-safe-dns-requests/</link>
		<comments>http://dylan.hardison.net/journal/2007/11/02/thread-safe-dns-requests/#comments</comments>
		<pubDate>Sat, 03 Nov 2007 03:30:32 +0000</pubDate>
		<dc:creator>dylan</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://dylan.hardison.net/2007/11/02/thread-safe-dns-requests/</guid>
		<description><![CDATA[I&#8217;ve been steadily working on a chat client, similar to irssi for a few months now. My design is mostly single-threaded, except for DNS queries. I use a GThreadPool (part of the lovely glib library) to run DNS lookups. I&#8217;d like to run several of these, which means I must use something that is thread-safe. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been steadily working on a chat client, similar to <a href="http://irssi.org">irssi</a> for a few months now.
My design is mostly single-threaded, except for DNS queries.
I use a GThreadPool (part of the lovely glib library) to run DNS lookups.
I&#8217;d like to run several of these, which means I must use something that is thread-safe.</p>

<p>The gethostbyname() C function is a typical way of looking up the IP of a given hostname. However, this function is inherently not thread-safe. The gnu libc provides gethostbyname_r, which is re-entrant. I could use this, but then I lose portability to platforms that use other libc implementations, such as OS X or one of the *BSDs.</p>

<p><em>However</em>, there is a standard (POSIX) thread-safe DNS lookup function! <a href="http://en.wikipedia.org/wiki/Getaddrinfo">getaddrinfo()</a>!</p>

<p>Now, the manpage for getaddrinfo(3) under OS X says it is not thread-safe, but this is actually just a result of a manpage not being updated since 2004. I wonder, are there any other (up-to-date) platforms where getaddrinfo is not thread safe?</p>
]]></content:encoded>
			<wfw:commentRss>http://dylan.hardison.net/journal/2007/11/02/thread-safe-dns-requests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>call-with-current-cuddle</title>
		<link>http://dylan.hardison.net/journal/2007/07/21/call-with-current-cuddle/</link>
		<comments>http://dylan.hardison.net/journal/2007/07/21/call-with-current-cuddle/#comments</comments>
		<pubDate>Sat, 21 Jul 2007 19:41:58 +0000</pubDate>
		<dc:creator>dylan</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://dylan.hardison.net/2007/07/21/call-with-current-cuddle/</guid>
		<description><![CDATA[hehe, I explained call/cc to spoony today &#8212; on paper &#8212; while we snuggled together. Actually, I had forgotten how it worked until we checked my example against Wikipedia.]]></description>
			<content:encoded><![CDATA[<p>hehe, I explained <a href="http://en.wikipedia.org/wiki/Call/cc">call/cc</a> to spoony today &#8212; on paper &#8212; while we snuggled together.</p>

<p>Actually, I had forgotten how it worked until we checked my example against Wikipedia.</p>
]]></content:encoded>
			<wfw:commentRss>http://dylan.hardison.net/journal/2007/07/21/call-with-current-cuddle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

