3 ms·
Wouldn't "runtime.LockOSThead()" help with the single-threaded API?
by bheadmaster 3y ago
Wouldn't "runtime.LockOSThead()" help with the single-threaded API?
- cyphar 3y agoNo, that only pins the current goroutine to a single OS thread (which is needed for some APIs -- namely, all of the other namespace APIs and some thread-related APIs). There is no way to make an entire Go program run as a single threaded program without using CGo the way we do in runc. Even GOMAXPROCS=1 doesn't work. CLONE_NEWUSER will always fail in a multi-threaded program.