yukuku / golang

Automatically exported from code.google.com/p/golang
0 stars 0 forks source link

runtime.GOMAXPROCS scheduler bug. #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile the attached file with the following line uncommented on a multicore 
machine:
_ = runtime.GOMAXPROCS( runtime.NumCPU() );
2. Run the binary.

What is the expected output? What do you see instead?
With the line commented out, it produces the following: 
[0 333328333350000 666699 365645 260400 215080 182910 167713 147560 135780 
132965 116831 110544 114218 105595 96235 97104 97393 85815 84721 83070 80850 
66990 63480 59360 54600 49166 43020 36120 28420 19870 10416 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]

What happens instead is the program deadlocks as all goroutines block.

What version of the product are you using? On what operating system?
6g version weekly.2012-01-27 11507 on Mac OS X 10.6. Also on a Linux Ubuntu box.

Please provide any additional information below.

Original issue reported on code.google.com by odysseus...@gmail.com on 3 Feb 2012 at 4:54

Attachments:

GoogleCodeExporter commented 9 years ago
Oops, this belongs elsewhere. Reposting to the main go issues page.

Original comment by odysseus...@gmail.com on 3 Feb 2012 at 5:24