Skip to content
This repository was archived by the owner on Jun 6, 2026. It is now read-only.
golang-designPublic archive

About

☠️ mkill limits the number of threads in a Go program, without crashing it.

Resources

Stars

23 stars

Watchers

1 watching

Forks

Repository files navigation

mkill

PkgGoDev Go Report Card mkill

Warning

This repository is archived and no longer maintained.

mkill capped the number of OS threads reactively: a background daemon polled ps once a second and reaped the surplus by spawning goroutines that lock an OS thread and exit. That approach is fragile (it shells out to ps, runs work on import, and kills threads it does not own).

Use golang.design/x/thread instead. Its thread.Pool caps threads by construction — work runs on a fixed set of owned threads, with no subprocess and no import-time side effects:

p := thread.NewPool(10)
defer p.Terminate()
p.Go(func() { /* runs on one of 10 owned threads */ })

Package mkill limits the number of threads in a Go program, without crash the whole program.

import "golang.design/x/mkill"

Quick Start

mkill.GOMAXTHREADS(10)

License

MIT © The golang.design Authors

About

☠️ mkill limits the number of threads in a Go program, without crashing it.

Resources

Stars

23 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages