Thread Pooling in Rust

A thread pool is a software design pattern where a set of worker threads is created to execute tasks concurrently. Instead of creating a new thread for each task, which can be resource-intensive, tasks are submitted to the pool and executed by available worker threads. This blog post will go through a simple thread pool implementation - similar to the one in Rust book - with a couple of simple enhancements....

September 6, 2024 · 13 min · Burak Sekili

Concurrency Notes in Go

Concurrency Channels Unbuffered channel If channel is unbuffered 1 ch := make(chan struct{}) sending a data to channel will block the goroutine as the channel is nil. 1 2 3 4 5 6 7 package main func main() { ch := make(chan struct{}) ch <- struct{}{} } Output of this program is: 1 2 3 4 5 6 7 $ go run main.go fatal error: all goroutines are asleep - deadlock!...

January 24, 2024 · 3 min · Burak Sekili