You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
http://play.golang.org/p/9xuV2BXGoK
1. run the example locally a few times
What do you see?
Channel lock:
rtn=2 cpu=1: 769
rtn=2 cpu=2: 944
rtn=2 cpu=3: 878
rtn=2 cpu=8: 784
rtn=3 cpu=1: 769
rtn=3 cpu=2: 819
rtn=3 cpu=3: 814
rtn=3 cpu=8: 793
Mutex:
rtn=2 cpu=1: 220
rtn=2 cpu=2: 13061
rtn=2 cpu=3: 5917
rtn=2 cpu=8: 788
rtn=3 cpu=1: 219
rtn=3 cpu=2: 1019
rtn=3 cpu=3: 1038
rtn=3 cpu=8: 1101
Quite often you can see a high performance drop (10x) when using a mutex with GOMAXPROCS
= 2/3 and 2 goroutines.
When using "go test" it seems to happen more consistently
(http://play.golang.org/p/5BYS-LEAFY).
Which compiler are you using (5g, 6g, 8g, gccgo)? 6g
Which operating system are you using? Windows 7, 64bit
Which version are you using? (run 'go version') go version devel +7d736eaa75da Tue Apr
02 15:08:28 2013 +1100 windows/amd64
Please provide any additional information below.
I tested it against go1.0.3 and it seems to work fine.
The text was updated successfully, but these errors were encountered:
If you are interested why chan does not have the same issue, runtime handles chan's in a
special way (active/passive spinning + thread parking instead of goroutine parking),
because it knowns that the critical section is bounded and small. For sync.Mutex it does
not have any knowledge as to critical section size.
The text was updated successfully, but these errors were encountered: