Re:Proposal: Non-cooperative goroutine preemption
by PDoyle on Thursday March 29, 2018 @01:52PM
(#16709252)
Pre-emptive runtimes are hard. Inserting yield points judiciously in loops isn't that incredibly difficult, and neither is reducing the cost of a yield point. It's far harder to make sure every machine instruction in every part of the runtime is prepared to be interrupted and have all it assumptions violated by the time it resumes.
[ Parent
| on HN ]
Re:Proposal: Non-cooperative goroutine preemption
by bradfitz on Thursday March 29, 2018 @02:24PM
(#16709625)
> Inserting yield points judiciously in loops isn't that incredibly difficult, and neither is reducing the cost of a yield point.
The Go team has done both over the past few years but we haven't been happy enough with the performance. Hence Austin's proposal.
Re:Proposal: Non-cooperative goroutine preemption
by zzzcpan on Thursday March 29, 2018 @02:26PM
(#16709647)
Imagine how much simpler and faster a runtime could be if every function was split into a series of non interruptible blocks. Sure, a bit tricky with loops, you'd have to cap them to make sure they are not hogging the system and you don't introduce too much overhead. But small price to pay for not wasting years of man-hours on silly low level stuff and barely achieving usable results.