<?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>O Blog do Gustavo Felisberto &#187; threads</title>
	<atom:link href="http://blog.felisberto.net/tag/threads/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.felisberto.net</link>
	<description>Life, the universe and all the rest</description>
	<lastBuildDate>Tue, 15 Mar 2011 11:57:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Hack != Do the right thing</title>
		<link>http://blog.felisberto.net/2007/05/10/hack-do-the-right-thing/</link>
		<comments>http://blog.felisberto.net/2007/05/10/hack-do-the-right-thing/#comments</comments>
		<pubDate>Thu, 10 May 2007 15:46:22 +0000</pubDate>
		<dc:creator>Gustavo Felisberto</dc:creator>
				<category><![CDATA[Geral]]></category>
		<category><![CDATA[base_de_dados]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[threads]]></category>

		<guid isPermaLink="false">http://blog.felisberto.net/2007/05/10/hack-do-the-right-thing/</guid>
		<description><![CDATA[Para começar devo dizer que acho estranho misturar blogs com mailling lists. Que raio tem uma coisa a ver com a outra? Nada&#8230; Penso eu de que. Mas parece que o Sr. Vitor Domingos gosta de mailling lists, e acha que os seus posts numa lista sua (apesar de tanto quanto sei publica) deve ir [...]]]></description>
			<content:encoded><![CDATA[<p><span class="dropcap">P</span>ara começar devo dizer que acho estranho misturar blogs com mailling lists.</p>
<blockquote><p>Que raio tem uma coisa a ver com a outra?</p></blockquote>
<p>Nada&#8230; Penso eu de que. Mas parece que o Sr. Vitor Domingos gosta de mailling lists, e acha que os seus posts numa lista sua (apesar de tanto quanto sei publica) deve ir aparecer num agregador de feeds de blogs. Até aqui tudo bem&#8230; Cada macaco no seu galho e cada maluco* com a sua mania.<br />
Tudo isto para dizer que o que vou aqui colocar é uma resposta, que teria sido mais simples se aquilo fosse um blog real&#8230; Mas adiante&#8230; Num <a href="http://lists.paradigma.pt/pipermail/tce/2007-May/000007.html">post recente</a> são referidos dois hacks que permitiram ao servidor do <a href="http://planeta.asterisco.pt/">Planeta A*</a> ter uma diminuição da carga com aumento de performance.<br />
O primeiro envolvia fazer o download das 80 e tal feeds que compõem o Planeta. Acredito que para algumas pessoas o acto de transformar um:<br />
<code lang="python"><br />
for url in list_of_feeds:<br />
    download_and_process(url)<br />
</code></p>
<p>em algo mais:<br />
<code lang="python"><br />
for url in list_of_feeds:<br />
    if num_threads < = 10:<br />
       download_and_process(url)<br />
    else:<br />
        wait_for_signal()<br />
</code></p>
<p>Seja algo que se pareça com um verdadeiro hack. Principalmente porque regra geral trabalhar com threads e concorrência seja chato.</p>
<p>Mas agora dizer que a criação de índices na base de dados é um hack... Por favor meus senhores... Que tal largar os livrinhos de mysql for dummies? Que tal pegar num <a href="http://www.amazon.com/Database-Systems-Complete-Hector-Garcia-Molina/dp/0130319953">livro de bases de dados</a> e aprender algo sobre como desenhar uma base de dados?</p>
<p>Isto é mais um desabafo de alguém que anda a pegar em código open source, e ao olhar para os .sql da criação da base de dados apanha erros daqueles de meia noite. Mas como diria o meu amigo Bruno:</p>
<blockquote><p>Isso és tu e o MV** que topam erros nos ER's só por olhar para eles.</p></blockquote>
<p>* Não estou a chamar maluco a ninguêm, é uma expressão idiomática<br />
** Não estamos a falar do Mário Valente..... Ou talvez estejamos, mas não o conhecemos</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.felisberto.net/2007/05/10/hack-do-the-right-thing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Python Threads and the GIL</title>
		<link>http://blog.felisberto.net/2007/04/11/python-threads-and-the-gil/</link>
		<comments>http://blog.felisberto.net/2007/04/11/python-threads-and-the-gil/#comments</comments>
		<pubDate>Wed, 11 Apr 2007 15:08:29 +0000</pubDate>
		<dc:creator>Gustavo Felisberto</dc:creator>
				<category><![CDATA[Ciência/Tecnologia]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[gil]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[threads]]></category>

		<guid isPermaLink="false">http://blog.felisberto.net/2007/04/11/python-threads-and-the-gil/</guid>
		<description><![CDATA[The Global Interpreter Lock is python&#8217;s way of solving the issues of multiple threads running on multiple cpu&#8217;s thrashing common data. What happens is that only one thread runs at any time. In the last week I&#8217;ve been implementing some search algorithms that would greatly benefit from multiple threads on multiple cpu&#8217;s. Some of you [...]]]></description>
			<content:encoded><![CDATA[<p><span class="dropcap">T</span>he Global Interpreter Lock is python&#8217;s way of solving the issues of multiple threads running on multiple cpu&#8217;s thrashing common data.<br />
What happens is that only one thread runs at any time.<br />
In the last week I&#8217;ve been implementing some search algorithms that would greatly benefit from multiple threads on multiple cpu&#8217;s. Some of you might say:</p>
<blockquote><p>If you are using Unix or Cygwin you can use os.fork()</p></blockquote>
<p>Yes I can, but I&#8217;m not even going to delve into the issues around Threads VS Fork in terms of the time it will take to spawn a thread or spawn another process. </p>
<p>In the work I was doing I would use threads to do very small (as in time) tasks, but spawning many threads in a small amount of time. Seems I&#8217;ll have to re-think the approach&#8230;..</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.felisberto.net/2007/04/11/python-threads-and-the-gil/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

