<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Io-Bound on Python Brasil — Aprenda Python em Português</title>
    <link>https://python.dev.br/tags/io-bound/</link>
    <description>Recent content in Io-Bound on Python Brasil — Aprenda Python em Português</description>
    <generator>Hugo</generator>
    <language>pt-br</language>
    <lastBuildDate>Thu, 23 Jul 2026 01:14:11 +0000</lastBuildDate>
    <atom:link href="https://python.dev.br/tags/io-bound/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Threading em Python: threads, Lock, Queue e ThreadPoolExecutor</title>
      <link>https://python.dev.br/blog/python-threading-threadpoolexecutor/</link>
      <pubDate>Thu, 23 Jul 2026 00:00:00 +0000</pubDate>
      <guid>https://python.dev.br/blog/python-threading-threadpoolexecutor/</guid>
      <description>&lt;p&gt;&lt;strong&gt;Para tarefas que passam boa parte do tempo esperando&lt;/strong&gt;, como consultar APIs, ler muitos arquivos, verificar URLs ou conversar com um banco de dados, &lt;code&gt;threading&lt;/code&gt; pode reduzir bastante o tempo total sem trocar toda a aplicação por &lt;code&gt;asyncio&lt;/code&gt;. A recomendação prática é direta: comece com &lt;code&gt;ThreadPoolExecutor&lt;/code&gt; para lotes independentes; use &lt;code&gt;threading.Thread&lt;/code&gt; quando precisar de workers persistentes; compartilhe o mínimo de estado possível; e adicione &lt;code&gt;Lock&lt;/code&gt;, &lt;code&gt;Queue&lt;/code&gt;, &lt;code&gt;Event&lt;/code&gt; ou &lt;code&gt;Semaphore&lt;/code&gt; somente quando houver uma necessidade concreta de coordenação.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
