3 ms·
> Go has hordes of green threads "goroutines" To clarify, they do not fall into the the strictest definition of green threads[1]. > [2]: As of Go 1.5, the def
by zamalek 10y ago
> Go has hordes of green threads "goroutines"
To clarify, they do not fall into the the strictest definition of green threads[1].
> [2]: As of Go 1.5, the default value of GOMAXPROCS is the number of CPUs (whatever your operating system considers to be a CPU) visible to the program at startup.
Prior to 1.5, the default value was '1' but could be changed.
> GUI model [...] Does that mean goroutines will fade into the background in Gallium?
The main concern at the moment seems to be wrapping the underlying APIs. However, I see channels being used for great effect further down the line:
var ui chan uiFunc = // ...
button1Click := make(chan ClickEvent)
go func() {
for evt := range button1Click {
ui <- func() { textBox1.setText("Button clicked!") }
}
}()
button1.onClick(button1Click)
I presume this also applies to interacting with the V8 ABI, seeing as JS is inherently single-threaded.
[1]: https://golang.org/pkg/runtime/#GOMAXPROCS https://golang.org/pkg/runtime/#GOMAXPROCS [2]: http://dave.cheney.net/tag/gomaxprocs http://dave.cheney.net/tag/gomaxprocs