Exemple #1
0
func BenchmarkBarrierNoGoroutine(b *testing.B) {
	for i := 0; i < b.N; i++ {
		var b Barrier
		b.Fall()
		<-b.Barrier()
	}
}
Exemple #2
0
func BenchmarkBarrier(b *testing.B) {
	for i := 0; i < b.N; i++ {
		var b Barrier
		go b.Fall()
		<-b.Barrier()
	}
}
Exemple #3
0
func BenchmarkForward(b *testing.B) {
	for i := 0; i < b.N; i++ {
		var b, f Barrier
		b.Forward(&f)
		go b.Fall()
		<-f.Barrier()
	}
}
Exemple #4
0
func BenchmarkForward2(b *testing.B) {
	for i := 0; i < b.N; i++ {
		var b, f, g Barrier
		b.Forward(&f)
		f.Forward(&g)
		go b.Fall()
		<-g.Barrier()
	}
}