Tag Archives: multi-threading

Unintuitive Multithreading: Communication Between Threads

This essay continues my exploration of misunderstandings about multi-threading. In the first essay of this series, Unintuitive Multithreading: Speed, I explained that multi-threading does not inherently speed up a process. In the second essay Unintuitive Multithreading: Waiting for Performance, I showed how to achieve better performance through waiting. In this essay, I plan to attack… Read More »

Unintuitive Multithreading: Waiting for Performance

This essay continues my exploration of misunderstandings about multi-threading. In the first essay of this series, Unintuitive Multithreading: Speed, I explained that multi-threading does not inherently speed up a process. In this essay, I plan to show how to not achieve more performance from a multi-threaded system. Many new multi-threading (MT) developers make the same… Read More »

Thread death

There is a subtle aspect of threads that may be worth exploring having to do with the concept of joining. Many threading systems support the possibility of waiting until a thread completes in order to retrieve its exit state. This is often started through a function called join(). In order to support this feature, a… Read More »

Worker thread patterns

Any system that uses the worker pattern may also want a dispatcher thread that wakes up workers and sends them on their way. In this approach, the dispatcher thread handles setting up the data needed to finish the task. The dispatcher may either choose a worker from a pool of suspended threads or create a… Read More »

Threading Patterns

Possibility of thinking of multi-threading design patterns as a way to organize threading code. Some possible patterns include: Fire and Forget (background thread) Periodic (Timer) IO thread Producer/Consumer Worker thread (work queue) Copier thread Pipeline (must be careful) Swarm? The background thread could be joined at a later time or a thread that runs it’s… Read More »