<?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: Day 19 – Gather and/or Coroutines</title>
	<atom:link href="http://perl6advent.wordpress.com/2012/12/19/gather-andor-coroutines/feed/" rel="self" type="application/rss+xml" />
	<link>http://perl6advent.wordpress.com/2012/12/19/gather-andor-coroutines/</link>
	<description>Something cool about Perl 6 every day</description>
	<lastBuildDate>Wed, 05 Jun 2013 15:41:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Ben Goldberg</title>
		<link>http://perl6advent.wordpress.com/2012/12/19/gather-andor-coroutines/#comment-3233</link>
		<dc:creator><![CDATA[Ben Goldberg]]></dc:creator>
		<pubDate>Sun, 03 Feb 2013 05:15:50 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=1775#comment-3233</guid>
		<description><![CDATA[The part of an HTTP request that takes the longest often isn&#039;t the downloading of the data, but rather the creation of the initial connection.

Thus, you should override connect, as well as read and recv.

The other problem is that the program will still yield ONCE within each of those methods, and then continue on to perform the original blocking io operation.

The apparent solution to this is to make the socket be nonblocking, and only yield if the connect or read or recv fails due to ewouldblock or eagain.  This, of course, results in polling (and much wasted cpu time) if all of the coroutines are waiting for connections or data.

The better solution, of course, is to make use of Parrot&#039;s new threads, and perform each $lwp.get in a separate thread.]]></description>
		<content:encoded><![CDATA[<p>The part of an HTTP request that takes the longest often isn&#8217;t the downloading of the data, but rather the creation of the initial connection.</p>
<p>Thus, you should override connect, as well as read and recv.</p>
<p>The other problem is that the program will still yield ONCE within each of those methods, and then continue on to perform the original blocking io operation.</p>
<p>The apparent solution to this is to make the socket be nonblocking, and only yield if the connect or read or recv fails due to ewouldblock or eagain.  This, of course, results in polling (and much wasted cpu time) if all of the coroutines are waiting for connections or data.</p>
<p>The better solution, of course, is to make use of Parrot&#8217;s new threads, and perform each $lwp.get in a separate thread.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
