Tech notes/concurrent futures and threadpoolexecutor

First published:

Last Edited:

Number of edits:

<p>In <a class="wikilink" href="/python/">Python</a>, when using the <a class="wikilink" href="/threadpoolexecutor/">ThreadPoolExecutor</a> of concurrent.futures, it is hard to know how many elements are waiting in the queue to be processed. The best I could gather is <sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup> :</p> <pre class="codehilite"><code class="language-python">executor._work_queue </code></pre> <p>That is the queue where the <code>WorkItems</code> are stored. </p> <ul> <li>Can it be a good idea to create my own <code>PoolExecutor</code>?</li> </ul> <div class="footnote"> <hr /> <ol> <li id="fn:1"> <p>https://github.com/python/cpython/blob/b5789a7419655f66692fab463320048bd2290e81/Lib/concurrent/futures/thread.py<a href="/tags/L187&#160;"><a href="/tags/L187&#160;"><a href="/tags/L187&#160;">#L187&#160;</a></a></a><a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text">&#8617;</a></p> </li> </ol> </div>

Backlinks

These are the other notes that link to this one.

Nothing links here, how did you reach this page then?

Comment

Share your thoughts on this note. Comments are not public, they are messages sent directly to my inbox.
Aquiles Carattino
Aquiles Carattino
This note you are reading is part of my digital garden. Follow the links to learn more, and remember that these notes evolve over time. After all, this website is not a blog.
© 2026 Aquiles Carattino
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License
Privacy Policy