SuperFastPython's profile picture. Making python developers awesome at concurrency.
#python #threading #multiprocessing #asyncio

Super Fast Python

@SuperFastPython

Making python developers awesome at concurrency. #python #threading #multiprocessing #asyncio

Przypięty

Discover how to execute Python loops using all CPU cores. Book: "Parallel Loops in Python" marvelous-writer-6152.ck.page/99ee689b9b

SuperFastPython's tweet image. Discover how to execute Python loops using all CPU cores.

Book: "Parallel Loops in Python"
marvelous-writer-6152.ck.page/99ee689b9b

Query the name of a running thread #Python #Concurrency

SuperFastPython's tweet image. Query the name of a running thread
#Python #Concurrency

Tip: Use exponential backoff in busy-wait loops to gradually increase wait times, minimizing resource consumption in Python programs. #Python #Concurrency

SuperFastPython's tweet image. Tip: Use exponential backoff in busy-wait loops to gradually increase wait times, minimizing resource consumption in Python programs.
#Python #Concurrency

Discover how to develop parallel for-loops with the multiprocessing Pool class. Book: "Python Multiprocessing Pool Jump-Start" superfastpython.com/python-multipr…

SuperFastPython's tweet image. Discover how to develop parallel for-loops with the multiprocessing Pool class.

Book: "Python Multiprocessing Pool Jump-Start"
superfastpython.com/python-multipr…

Create and start a thread with custom name #Python #Concurrency

SuperFastPython's tweet image. Create and start a thread with custom name
#Python #Concurrency

Tip: Consider time.sleep() or asyncio.sleep() in Python loops to reduce CPU usage during busy waiting when waiting for external conditions. #Python #Concurrency

SuperFastPython's tweet image. Tip: Consider time.sleep() or asyncio.sleep() in Python loops to reduce CPU usage during busy waiting when waiting for external conditions.
#Python #Concurrency

Use multiprocessing.Pool for parallel pipeline stages #Python #Concurrency

SuperFastPython's tweet image. Use multiprocessing.Pool for parallel pipeline stages
#Python #Concurrency

Tip: Use spin locks only for short critical sections in Python, as they continuously consume CPU cycles while waiting. #Python #Concurrency

SuperFastPython's tweet image. Tip: Use spin locks only for short critical sections in Python, as they continuously consume CPU cycles while waiting.
#Python #Concurrency

Use ThreadPoolExecutor for a two-stage pipeline pattern #Python #Concurrency

SuperFastPython's tweet image. Use ThreadPoolExecutor for a two-stage pipeline pattern
#Python #Concurrency

Use asyncio for an asynchronous pipeline pattern #Python #Concurrency

SuperFastPython's tweet image. Use asyncio for an asynchronous pipeline pattern
#Python #Concurrency

Tip: Avoid busy waiting in Python by using synchronization primitives like threading.Event or Condition to block efficiently until a signal is received. #Python #Concurrency

SuperFastPython's tweet image. Tip: Avoid busy waiting in Python by using synchronization primitives like threading.Event or Condition to block efficiently until a signal is received.
#Python #Concurrency

Use multiprocessing for a multi-stage pipeline pattern #Python #Concurrency

SuperFastPython's tweet image. Use multiprocessing for a multi-stage pipeline pattern
#Python #Concurrency

Tip: Optimize task granularity in Python to ensure each parallel job is large enough to offset the overhead of process management. #Python #Concurrency

SuperFastPython's tweet image. Tip: Optimize task granularity in Python to ensure each parallel job is large enough to offset the overhead of process management.
#Python #Concurrency

Loading...

Something went wrong.


Something went wrong.