3 ms·
while they have added some preemption to the scheduler, go is still generally cooperative multitasking. I believe function calls are also schedule points now. I
by ominous_prime 13y ago
while they have added some preemption to the scheduler, go is still generally cooperative multitasking. I believe function calls are also schedule points now. If you have a cpu-intensive loop you want to yield from at certain points, stick a runtime.GoSched in there. Having a busy-loop in your code is going to mess things up, and is usually a bug anyway.
- masklinn 13y ago> Having a busy-loop in your code is going to mess things up, and is usually a bug anyway. A busy loop is a sufficient way to emulate a heavy computation (e.g. applying effects to image files or compressing data) when it's not optimized out.