Hello,
I ran a Go program with GOMAXPROCS=1 and two goroutines which both did 
"runtime.LockOSThread()" and slept 10 seconds before exiting.

Code: https://play.golang.org/p/4R-WlCiKNT

Since I had 1 OS thread and 2 goroutines trying to lock an OS thread, I was 
expecting only one of them to complete first before the other one 
started... because the documentation said "Until the calling goroutine 
exits or calls UnlockOSThread, it will always execute in that thread, *and 
no other goroutine can*."

However the output shows that both goroutines execute in parallel, 
contradicting LockOSThread documentation.
Can someone explain if the documentation is wrong, if its a bug, or a 
better way to understand how these constructs work?
Regards,
Srimanth

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to