1
0
mirror of https://github.com/golang/go synced 2024-11-21 23:54:40 -07:00
go/test/golden.out
Adam Langley 50d6c81d4a runtime: fix race condition
(Thanks to ken and rsc for pointing this out)

rsc:
	ken pointed out that there's a race in the new
	one-lock-per-channel code.  the issue is that
	if one goroutine has gone to sleep doing

	select {
	case <-c1:
	case <-c2:
	}

	and then two more goroutines try to send
	on c1 and c2 simultaneously, the way that
	the code makes sure only one wins is the
	selgen field manipulation in dequeue:

	       // if sgp is stale, ignore it
	       if(sgp->selgen != sgp->g->selgen) {
		       //prints("INVALID PSEUDOG POINTER\n");
		       freesg(c, sgp);
		       goto loop;
	       }

	       // invalidate any others
	       sgp->g->selgen++;

	but because the global lock is gone both
	goroutines will be fiddling with sgp->g->selgen
	at the same time.

This results in a 7% slowdown in the single threaded case for a
ping-pong microbenchmark.

Since the cas predominantly succeeds, adding a simple check first
didn't make any difference.

R=rsc
CC=golang-dev
https://golang.org/cl/180068
2009-12-18 12:25:53 -08:00

151 lines
2.1 KiB
Plaintext

== ./
=========== ./cmp2.go
comparing uncomparable type []int
throw: interface compare
panic PC=xxx
=========== ./cmp3.go
comparing uncomparable type []int
throw: interface compare
panic PC=xxx
=========== ./cmp4.go
hash of unhashable type []int
throw: interface hash
panic PC=xxx
=========== ./cmp5.go
hash of unhashable type []int
throw: interface hash
panic PC=xxx
=========== ./helloworld.go
hello, world
=========== ./peano.go
0! = 1
1! = 1
2! = 2
3! = 6
4! = 24
5! = 120
6! = 720
7! = 5040
8! = 40320
9! = 362880
=========== ./printbig.go
-9223372036854775808
9223372036854775807
=========== ./sigchld.go
survived SIGCHLD
=========== ./turing.go
Hello World!
== ken/
=========== ken/intervar.go
print 1 bio 2 file 3 -- abc
=========== ken/label.go
100
=========== ken/rob1.go
9876543210
=========== ken/rob2.go
(defn foo (add 12 34))
=========== ken/simpprint.go
hello world
=========== ken/simpswitch.go
0out01out12out2aout34out4fiveout56out6aout78out89out9
=========== ken/string.go
abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz
== chan/
=========== chan/doubleselect.go
PASS
=========== chan/nonblock.go
PASS
== interface/
=========== interface/fail.go
*main.S is not main.I: missing method Foo
throw: interface conversion
panic PC=xxx
=========== interface/returntype.go
*main.S is not main.I2: missing method Name
throw: interface conversion
panic PC=xxx
== nilptr/
== fixedbugs/
=========== fixedbugs/bug016.go
fixedbugs/bug016.go:11: constant -3 overflows uint
=========== fixedbugs/bug027.go
hi
0 44444
1 3333
2 222
3 11
4 0
0 44444
1 3333
2 222
3 11
4 0
=========== fixedbugs/bug067.go
ok
=========== fixedbugs/bug070.go
outer loop top k 0
inner loop top i 0
do break
broke
=========== fixedbugs/bug081.go
fixedbugs/bug081.go:9: fatal error: typecheck loop
=========== fixedbugs/bug093.go
M
=========== fixedbugs/bug113.go
interface is int, not int32
throw: interface conversion
panic PC=xxx
=========== fixedbugs/bug148.go
2 3
interface is main.T, not main.T·1
throw: interface conversion
panic PC=xxx
== bugs/
=========== bugs/bug219.go
bugs/bug219.go:16: syntax error near if
BUG: bug219