Peter Mbanugo

Peter Mbanugo

@pmbanugo.me

Software engineer/consultant, trainer, and author @pluralsight. Creator of Tina (a concurrency framework) and learnconcurrency.dev Interest: Web performance, continuous delivery, philosophy https://www.youtube.com/@pmbanugo

262 followers191 following259 posts

Pinned

I wrote an article two months ago, which shows a glimpse of what the examples could be like. At that time I was still exploring the right example and how it can evolve. There's more to it now but this article is still a good starting point IMO. Link: pmbanugo.me/blog/crash-c...

pmbanugo.meA Crash Course on Concurrency: Build a Tiny Scheduler from ScratchBuild a tiny concurrency runtime from scratch and discover how schedulers, task switching, yielding, coroutine state, and event loops work under the hood
Peter Mbanugo@pmbanugo.me

I’m writing a hands-on book series about concurrency, for anyone who wants to understand what happens behind async/await or coroutines. You’ll build a small concurrency runtime, step by step, and see how tasks pause, resume, and wait on each other. more info on the video and thread

Peter Mbanugo reposted

Tina, Odin's concurrency framework with + a HTTP Server (Tina HTTP) just hit 140 stars on GitHub. Do with that what you may 😉

Peter Mbanugo reposted

I’m writing a hands-on book series about concurrency, for anyone who wants to understand what happens behind async/await or coroutines. You’ll build a small concurrency runtime, step by step, and see how tasks pause, resume, and wait on each other. more info on the video and thread

I’m writing a hands-on book series about concurrency, for anyone who wants to understand what happens behind async/await or coroutines. You’ll build a small concurrency runtime, step by step, and see how tasks pause, resume, and wait on each other. more info on the video and thread

The examples use Odin, but there'll be notes for Go, Rust, Zig, or even C programmers to be able to follow along. You’ll predict what happens, run the code, and inspect the execution trace. Interested? Get early chapters and exercises as they’re ready at learnconcurrency.dev

learnconcurrency.devBuild a concurrency runtime. Understand it from the inside.Make async and coroutines something you can see, build, and explain. A hands-on book series by Peter Mbanugo. Sign up for early access.

This book project grew out of my work on Tina, the concurrency framework in Odin. I’m working on Tina’s rewrite and aiming to share more in November or December, and I'll work on both concurrently ;) If you know someone who’d enjoy this, please share the first post with them 🙏🏽

250 stars (and counting) for TINA — A concurrency framework for Odin, with extensions for building web/infra software. Expect a few interesting changes in the next release. I'm also writing a few articles on Odin. I hope I can get them all done by the end of June. github.com/pmbanugo/tina

Tina, Odin's concurrency framework with + a HTTP Server (Tina HTTP) just hit 140 stars on GitHub. Do with that what you may 😉

I don't think I ever got this speed when running just even way less test in JavaScript land. Takes between 1.x to 3.5 ms. Thank you Odin. It just needs a good web dev story to get Go and JS folks to consider it.

Peter Mbanugo reposted

After reading Posthog's blog about their recent issue and fix regarding their use of Tokio + Rayon, I decided to write about it. Unrelated to Rust, but a common problem I see with async/await as a primitive for concurrency. What do you think? pmbanugo.me/blog/why-asy...

pmbanugo.meThe Tokio/Rayon Trap and Why Async/Await Fails ConcurrencyAsync/await makes concurrency easy to write, but incredibly complex to operate. Read on for why the Tokio/Rayon boundary is failing in production, and how explicit state machines fix it.

After reading Posthog's blog about their recent issue and fix regarding their use of Tokio + Rayon, I decided to write about it. Unrelated to Rust, but a common problem I see with async/await as a primitive for concurrency. What do you think? pmbanugo.me/blog/why-asy...

pmbanugo.meThe Tokio/Rayon Trap and Why Async/Await Fails ConcurrencyAsync/await makes concurrency easy to write, but incredibly complex to operate. Read on for why the Tokio/Rayon boundary is failing in production, and how explicit state machines fix it.

2 weeks after public release, Tina is gaining some eyeballs. if you haven't already, check it out — don't say I didn't tell you :) I'm currently working on adding a HTTP lib extension, and in the process decided I had to change some things at the core for better socket handling.

What happens when you combine Erlang-style concurrency + ScyllaDB's Seastar speed + deterministic simulation? Meet Tina: A strictly bounded, fault-tolerant, thread-per-core concurrency framework. 🧵👇

View full thread

Instead of coloured functions or promise hell, you write Isolates (They don't block nor await). An Isolate receives a message, updates its state, and returns an Effect (Yield, Receive/Reply, IO, Crash) to the user-space scheduler.

What happens when you combine Erlang-style concurrency + ScyllaDB's Seastar speed + deterministic simulation? Meet Tina: A strictly bounded, fault-tolerant, thread-per-core concurrency framework. 🧵👇

View full thread

I achieved this by strictly limiting what the programmer can do. Architecture constraint solves problems better than language features. So I chose these constraints: 🚫 No Garbage Collection. 🚫 No async/await. 🚫 No Mutexes. 🚫 No hidden allocations after boot.

The architecture maps directly to the hardware constraint: 1. The Shard (Cell): 1 OS thread pinned to 1 CPU core. 2. The Isolates: lightweight processes representing a unit of concurrent execution. 3. The Grand Arena: A single memory block, partitioned at boot.

What happens when you combine Erlang-style concurrency + ScyllaDB's Seastar speed + deterministic simulation? Meet Tina: A strictly bounded, fault-tolerant, thread-per-core concurrency framework. 🧵👇

Software engineers usually have to compromise between speed and safety. You get the BEAM’s "let it crash" reliability, but pay with VM/GC overhead. Or you get C/Rust speed, but fight mutexes and async/await fragmentation. Tina was built to reject this compromise.

AI coding accelerates software pollution and further advances bad education on what it takes to make software Just as ppl expected the increase in software performance with 5 - 20x hardware performance decades ago. They’re doing a similar thing with AI - better hardware & models

My current experiment is around stealing some ideas from the BEAM and combining with some from Seastar (C++ framework) Hopefully it comes out good enough for me to share it publicly. Imagine-> BEAM (fault-tolerance) + Seastar (Shards) = 💭

Elimination is a core part of software optimisation. But it also carries over into other areas of life. If you can eliminate, thereby reducing the amount of task or functions you would like to do, you have enough memory space to juggle the vital few

Most bugs exist because we only test scenarios we thought of. What about the ones we didn’t imagine? I’m building a formal verification tool from scratch and documenting everything — parser, VM, state-space exploration. You can follow along in my journey: pmbanugo.me/series/forma...

pmbanugo.meBuilding a Formal Verification Tool from ScratchA deep dive into building a TLA-based formal verification tool from scratch. Learn systems programming, virtual machines, parsers, compilers, and formal method by building a real tool.

Turning academic papers into working code I recently dove into the paper "𝘽𝙞𝙣𝙖𝙧𝙮 𝙁𝙪𝙨𝙚 𝙁𝙞𝙡𝙩𝙚𝙧𝙨: 𝙁𝙖𝙨𝙩 𝙖𝙣𝙙 𝙎𝙢𝙖𝙡𝙡𝙚𝙧 𝙏𝙝𝙖𝙣 𝙓𝙤𝙧 𝙁𝙞𝙡𝙩𝙚𝙧𝙨" by Graf and Daniel Lemire. I wanted to understand how we can store millions of keys efficiently in memory without the overhead of standard hash tables or Bloom filters.🧵

implemented the algorithm in Odin as part of my deep dive into Data Structures and Algorithms. 𝗧𝗵𝗲 𝗧𝗟;𝗗𝗥: Binary Fuse Filters use a peeling algorithm to compress data down to theoretical limits. The implementation achieves: ✅ ~9 bits per entry ✅ 0.4% False Positive Rate ✅ Branchless query logic

I used the Die Hard water-jug puzzle to understand model checking, by building a naive solver. I only defined the rules; the strategy emerged from exploring every timeline/state. That’s why formal verification catches bugs tests miss. Part 1: pmbanugo.me/blog/tla-for...

pmbanugo.meBuilding a Formal Verification Tool from Scratch: Part 1 (Die Hard Edition)What if you could explore every possible timeline of your distributed system to find the bugs you haven't imagined yet? I'm building a TLA model checker from scratch to understand how formal verificat...

Christmas sale discount 50% Limited seats available

Peter Mbanugo@pmbanugo.me

𝗜𝗳 𝘆𝗼𝘂 𝘄𝗮𝗻𝘁 𝘁𝗼 𝗯𝗲 𝗮 𝟭𝟬𝘅 𝗽𝗿𝗼𝗴𝗿𝗮𝗺𝗺𝗲𝗿, 𝗿𝗲𝗶𝗻𝘃𝗲𝗻𝘁 𝘁𝗵𝗲 𝘄𝗵𝗲𝗲𝗹. 𝗕𝘂𝗶𝗹𝗱 𝗮 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲. 𝗕𝘂𝗶𝗹𝗱 𝗮 𝗹𝗼𝗮𝗱 𝗯𝗮𝗹𝗮𝗻𝗰𝗲𝗿. 𝗕𝘂𝗶𝗹𝗱 𝗮 𝗣𝘂𝗯/𝗦𝘂𝗯 𝗲𝗻𝗴𝗶𝗻𝗲. Join this workshop where you will build a nats.io pub/sub server from scratch. 𝗙𝗼𝘂𝗻𝗱𝗶𝗻𝗴 𝗠𝗲𝗺𝗯𝗲𝗿 𝗽𝗿𝗶𝗰𝗲 (𝟲𝟬% 𝗼𝗳𝗳) 𝗲𝗻𝗱𝘀 𝗼𝗻 𝗗𝗲𝗰𝗲𝗺𝗯𝗲𝗿 𝟭 𝟭𝟭:𝟱𝟵 𝗣𝗠 𝗛𝗦𝗧. Go to protocol-zero.pmbanugo.me

Peter Mbanugo reposted

𝗜𝗳 𝘆𝗼𝘂 𝘄𝗮𝗻𝘁 𝘁𝗼 𝗯𝗲 𝗮 𝟭𝟬𝘅 𝗽𝗿𝗼𝗴𝗿𝗮𝗺𝗺𝗲𝗿, 𝗿𝗲𝗶𝗻𝘃𝗲𝗻𝘁 𝘁𝗵𝗲 𝘄𝗵𝗲𝗲𝗹. 𝗕𝘂𝗶𝗹𝗱 𝗮 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲. 𝗕𝘂𝗶𝗹𝗱 𝗮 𝗹𝗼𝗮𝗱 𝗯𝗮𝗹𝗮𝗻𝗰𝗲𝗿. 𝗕𝘂𝗶𝗹𝗱 𝗮 𝗣𝘂𝗯/𝗦𝘂𝗯 𝗲𝗻𝗴𝗶𝗻𝗲. Join this workshop where you will build a nats.io pub/sub server from scratch. 𝗙𝗼𝘂𝗻𝗱𝗶𝗻𝗴 𝗠𝗲𝗺𝗯𝗲𝗿 𝗽𝗿𝗶𝗰𝗲 (𝟲𝟬% 𝗼𝗳𝗳) 𝗲𝗻𝗱𝘀 𝗼𝗻 𝗗𝗲𝗰𝗲𝗺𝗯𝗲𝗿 𝟭 𝟭𝟭:𝟱𝟵 𝗣𝗠 𝗛𝗦𝗧. Go to protocol-zero.pmbanugo.me

protocol-zero.pmbanugo.meStop Trusting Magic Boxes. Build Your Own Pub/Sub.Don't just use Redis/NATS. Build it. A 2-day workshop & course on System Programming. Pre-Order now for 60% OFF.

𝗜𝗳 𝘆𝗼𝘂 𝘄𝗮𝗻𝘁 𝘁𝗼 𝗯𝗲 𝗮 𝟭𝟬𝘅 𝗽𝗿𝗼𝗴𝗿𝗮𝗺𝗺𝗲𝗿, 𝗿𝗲𝗶𝗻𝘃𝗲𝗻𝘁 𝘁𝗵𝗲 𝘄𝗵𝗲𝗲𝗹. 𝗕𝘂𝗶𝗹𝗱 𝗮 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲. 𝗕𝘂𝗶𝗹𝗱 𝗮 𝗹𝗼𝗮𝗱 𝗯𝗮𝗹𝗮𝗻𝗰𝗲𝗿. 𝗕𝘂𝗶𝗹𝗱 𝗮 𝗣𝘂𝗯/𝗦𝘂𝗯 𝗲𝗻𝗴𝗶𝗻𝗲. Join this workshop where you will build a nats.io pub/sub server from scratch. 𝗙𝗼𝘂𝗻𝗱𝗶𝗻𝗴 𝗠𝗲𝗺𝗯𝗲𝗿 𝗽𝗿𝗶𝗰𝗲 (𝟲𝟬% 𝗼𝗳𝗳) 𝗲𝗻𝗱𝘀 𝗼𝗻 𝗗𝗲𝗰𝗲𝗺𝗯𝗲𝗿 𝟭 𝟭𝟭:𝟱𝟵 𝗣𝗠 𝗛𝗦𝗧. Go to protocol-zero.pmbanugo.me

protocol-zero.pmbanugo.meStop Trusting Magic Boxes. Build Your Own Pub/Sub.Don't just use Redis/NATS. Build it. A 2-day workshop & course on System Programming. Pre-Order now for 60% OFF.
Peter Mbanugo@pmbanugo.me

Stop building To-Do apps. 🛑 If you want to be a 10x programmer, reinvent the wheel. Build a Database, a load balancer, Pub/Sub engine. I’m launching a workshop where we build a NATS-compatible server from scratch. More info at protocol-zero.pmbanugo.me Founding Member pricing is live from 27 Nov.

Stop building To-Do apps. 🛑 If you want to be a 10x programmer, reinvent the wheel. Build a Database, a load balancer, Pub/Sub engine. I’m launching a workshop where we build a NATS-compatible server from scratch. More info at protocol-zero.pmbanugo.me Founding Member pricing is live from 27 Nov.

protocol-zero.pmbanugo.meStop Trusting Magic Boxes. Build Your Own Pub/Sub.Don't just use Redis/NATS. Build it. A 2-day workshop & course on System Programming. Pre-Order now for 60% OFF.

Processed 1 BILLION rows (14.8GB file) 4.7x FASTER 🤯 with a single-threaded Node.js. How? *Byte Parsing *Integer Math *Used hashing to keep Map lookups fast. Full technical breakdown and code in the linked blog post: pmbanugo.me/blog/nodejs-... #Nodejs #1BRC #Performance #JavaScript #Programming

pmbanugo.meNode.js Performance: Processing 14GB Files 78% Faster with Buffer OptimizationLearn how to optimize Node.js for processing large files: 14GB of data processed 78% faster using buffer streaming, byte-level parsing, and hash-based lookups. Complete guide with benchmarks, profilin...