4 ms·
That's interesting with the M:N threading model. But would that require that I set the M/N ratio (or "multiplexing factor" or what to call it) to a fixed value,
by samuell 12y ago
That's interesting with the M:N threading model. But would that require that I set the M/N ratio (or "multiplexing factor" or what to call it) to a fixed value, unlike the ability in Go to automatically multiplex any number of go-routines on the (fixed) number of OS threads?
- army 12y agoGo's threading model is M:N threading. N is the fixed number of kernel threads, M is the variable number of application threads.
- steveklabnik 12y agoI'm not intimately familiar with Go's details here, but you can either just say 'run these green threads kthx' in which that factor is chosen for you, or you can use an explicit pool(s) and do it yourself. Details: http://doc.rust-lang.org/green/index.html http://doc.rust-lang.org/green/index.html
- pcwalton 12y agolibgreen will automatically pick a reasonable default number of OS threads to use if you don't, based on the number of CPU cores. (This is different from the way GOMAXPROCS works.) You may spawn any number of tasks and they will be automatically multiplexed onto those threads.