go - Does runtime.LockOSThread allow child goroutines to run in same OS thread? -


i understand in go, runtime.lockosthread() bind goroutine 1 os thread , not allow other goroutines execute in thread. true child goroutines?

for example:

runtime.lockosthread() go func() {     go func() {         //     }()     // }() 

do both of these goroutines execute in single , exclusive os thread or first one?

the documentation runtime.lockosthread says:

lockosthread wires the calling goroutine current operating system thread. until calling goroutine exits or calls unlockosthread, execute in thread, and no other goroutine can.

(emphasis mine)

this means if implementation of go did you're asking, faulty.

to clarify: if goroutine had reserved thread , goroutine executed on same thread; that's wrong.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Website Login Issue developed in magento -

Can the constants be defined inside a model file of a framework in PHP? -