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

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -