4 ms·
This tends not to be an issue in practice as you almost always have non-inlined function calls or short-executing loops. The one way in which this might be a pr
by aaronblohowiak 13y ago
This tends not to be an issue in practice as you almost always have non-inlined function calls or short-executing loops. The one way in which this might be a problem is if you try and implement a spinlock, but there is no excuse for that given the go concurrency features.
- masklinn 13y ago> This tends not to be an issue in practice as you almost always have non-inlined function calls or short-executing loops. Until it's an issue because somebody set up CPU-bound image processing, and then by lying you've set people up for failure and you've given them a huge blind spot once things start not working correctly.
- aaronblohowiak 13y agoGood point. It was a shortcut that I shouldn't have taken.
- burntsushi 13y agoYou're right, it's generally not an issue. Acting like Goroutines are preemptive isn't likely to land you in a lot of trouble. Nevertheless, they aren't preemptive, so you shouldn't say that they are. Maybe "almost preemptive"?
- aaronblohowiak 13y ago:) I like that phrasing, it gets to the main result (you shouldnt ever worry about it) while still giving you the out that more leaks under the covers (in case you think this might be biting you.)
- pcwalton 13y agoIf you use libgreen in Rust, you don't even have the preemption at function calls, and it works OK. I agree that this isn't much of an issue in practice.