High-Load CGo: Calling Nonblocking C/C++ Code Without Surprise
summary
The talk explains pitfalls and techniques for calling non-blocking C/C++ code from Go using cgo, focusing on cases like async OS I/O and CPU-heavy tasks (compression, crypto, math). It covers how cgo interacts with Go's scheduler and threads and presents practical approaches to avoid unexpected blocking when integrating C/C++ libraries into high-load Go services.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 2:17CGO load problems
- 5:26How CGO works
- 7:59Goroutine carousel effect
- 11:13Goroutine limiting fix
- 13:40Nonblocking calls without assembly
- 17:31Implementing blocking calls
- 20:41Benchmark method comparison
- 22:45Final solution comparison
- 23:51Summary and recommendations
- 24:57Q&A
related talks
34mHigh-load CGo: calling nonblocking C/C++ code without surprise ☠️
24mMastering Concurrency in Go: From Patterns to Production
16mIn the Land of Gophers (from Age 3)
31mConcurrent Server Architectures
22mTales of Go Runtime Scheduler
47mQueues, Fairness, and The Go Scheduler
12mOptimistic Concurrency Control for Real-world Go Programs
44mConcurrency in Go: from hardware to code ☠️
