bobuhiro11 / gokvm

KVM based tiny x86 hypervisor written in pure golang, which can boot Linux
https://blog.bobuhiro11.net/tags/gokvm.html
MIT License
206 stars 21 forks source link

do not start goroutines in packages; use errgroup #175

Closed rminnich closed 1 month ago

rminnich commented 2 months ago

Starting goroutines in packages is now frowned upon. Also, we can use errgroup to simplify the code.

This is not quite bringing them up to the top; but they are in vmm, and they do use errgroup.

Now, when you do ^Ax it does not call os.Exit(0), which is better behavior.

But we need to add context support, so we can cancel everything when either a processor or the console exits.

bobuhiro11 commented 1 month ago

Thank you. It works as expected