[{"data":1,"prerenderedAt":76},["ShallowReactive",2],{"term-w\u002Fwork-stealing":3,"related-w\u002Fwork-stealing":59},{"id":4,"title":5,"acronym":6,"body":7,"category":40,"description":41,"difficulty":42,"extension":43,"letter":44,"meta":45,"navigation":46,"path":47,"related":48,"seo":53,"sitemap":54,"stem":57,"subcategory":6,"__hash__":58},"terms\u002Fterms\u002Fw\u002Fwork-stealing.md","Work Stealing",null,{"type":8,"value":9,"toc":33},"minimark",[10,15,19,23,26,30],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 - The Vibe Check",[16,17,18],"p",{},"Work stealing is how a pool of worker threads keeps itself busy without a manager micromanaging every task. Each worker has its own queue of jobs it works through, but the moment a worker runs out of work, it sneaks over and steals a task off the back of a busier worker's queue instead of sitting idle. Nobody's ever left with nothing to do while somebody else is drowning.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"Work stealing is a scheduling strategy where each worker thread maintains its own local deque of tasks, primarily pushing and popping from one end for cache locality, while idle workers steal tasks from the opposite end of another worker's queue when their own queue is empty. It achieves good load balancing with far less lock contention than a single shared task queue, and is the scheduling model behind Go's goroutine scheduler, Rust's Rayon, and Java's ForkJoinPool.",[11,27,29],{"id":28},"when-youll-hear-this","When You'll Hear This",[16,31,32],{},"\"Go's runtime uses work stealing so goroutines balance across cores automatically.\" \u002F \"Rayon's work-stealing scheduler is why that parallel iterator scales so well.\"",{"title":34,"searchDepth":35,"depth":35,"links":36},"",2,[37,38,39],{"id":13,"depth":35,"text":14},{"id":21,"depth":35,"text":22},{"id":28,"depth":35,"text":29},"architecture","Work stealing is how a pool of worker threads keeps itself busy without a manager micromanaging every task.","advanced","md","w",{},true,"\u002Fterms\u002Fw\u002Fwork-stealing",[49,50,51,52],"Lock Contention","Green Thread","Context Switch","NUMA",{"title":5,"description":41},{"changefreq":55,"priority":56},"weekly",0.7,"terms\u002Fw\u002Fwork-stealing","TD3WVb6gKHjlLR6EpId3HnmibPgFGF9TRQ97Js7tEaM",[60,65,69,72],{"title":51,"path":61,"acronym":6,"category":62,"difficulty":63,"description":64},"\u002Fterms\u002Fc\u002Fcontext-switch","backend","intermediate","A context switch is the CPU pausing whatever thread it's running, carefully saving all its progress like a bookmark, and loading up a completely different...",{"title":50,"path":66,"acronym":6,"category":67,"difficulty":42,"description":68},"\u002Fterms\u002Fg\u002Fgreen-thread","general","Green threads are fake threads managed by your programming language instead of the operating system.",{"title":49,"path":70,"acronym":6,"category":62,"difficulty":63,"description":71},"\u002Fterms\u002Fl\u002Flock-contention","Lock contention is what happens when a mutex becomes the most popular door in the building, and instead of doing useful work, half your threads are just st...",{"title":52,"path":73,"acronym":74,"category":40,"difficulty":42,"description":75},"\u002Fterms\u002Fn\u002Fnuma","Non-Uniform Memory Access","On a big multi-socket server, not all memory is created equal, memory attached to your CPU socket is fast to reach, and memory attached to the other socket...",1792528063613]