It is important to follow best practices when using the ThreadPoolExecutor in Python. Best practices allow you to side-step the most common errors …
Continue Reading about ThreadPoolExecutor Best Practices in Python →
Tutorials on the ThreadPoolExecutor class for concurrency in Python.
by Jason Brownlee in ThreadPoolExecutor
It is important to follow best practices when using the ThreadPoolExecutor in Python. Best practices allow you to side-step the most common errors …
Continue Reading about ThreadPoolExecutor Best Practices in Python →
by Jason Brownlee in ThreadPoolExecutor
You can stop all tasks if one task fails with the ThreadPoolExecutor in Python by using a threading.Event and waiting for tasks with the wait() module …
Continue Reading about How to Stop All Tasks if One Task Fails in the ThreadPoolExecutor in Python →
by Jason Brownlee in ThreadPoolExecutor
You can submit a follow-up task to a ThreadPoolExecutor by calling the submit() function. In this tutorial, you will discover how to submit …
Continue Reading about How to Submit a Follow-up Task to a ThreadPoolExecutor in Python →
by Jason Brownlee in ThreadPoolExecutor
You can handle exceptions in the ThreadPoolExecutor raised by tasks by catching them when getting the result. In this tutorial, you will discover …
Continue Reading about How to Handle Exceptions in Tasks With the ThreadPoolExecutor in Python →
by Jason Brownlee in ThreadPoolExecutor
You can set ThreadPoolExecutor initializer functions via the initializer argument. In this tutorial, you will discover how to set the initializer …
Continue Reading about ThreadPoolExecutor Initializer Functions in Python →
by Jason Brownlee in ThreadPoolExecutor
You can configure the number of threads in the ThreadPoolExecutor in Python by setting the max_workers argument. In this tutorial, you will …
Continue Reading about Configure Max Workers for the ThreadPoolExecutor →
by Jason Brownlee in ThreadPoolExecutor
You can use thread local data by passing an instance of local to task functions in the ThreadPoolExecutor in Python. In this tutorial, you will …
Continue Reading about Thread-Local With ThreadPoolExecutor in Python →
by Jason Brownlee in ThreadPoolExecutor
Use map() when converting a for-loop to use threads and use submit() when you need more control over asynchronous tasks when using the …
Continue Reading about map() vs. submit() With the ThreadPoolExecutor in Python →
by Jason Brownlee in ThreadPoolExecutor
You can wait for the first task to finish in the ThreadPoolExecutor by calling the wait() function with return_when set to FIRST_COMPLETED. In this …
Continue Reading about How to Wait For The First Task To Finish In The ThreadPoolExecutor →
What if you could use modern thread pools to run each task simultaneously in separate threads?
The ThreadPoolExecutor class provides easy-to-use thread-based concurrency.
Introducing: "Python ThreadPoolExecutor Jump-Start".
This is a new book designed to teach you how to use the ThreadPoolExecutor step-by-step, super fast!