- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for BenchmarkUncontendedSemaphore (0.28 sec)
-
src/sync/mutex_test.go
func TestSemaphore(t *testing.T) { s := new(uint32) *s = 1 c := make(chan bool) for i := 0; i < 10; i++ { go HammerSemaphore(s, 1000, c) } for i := 0; i < 10; i++ { <-c } } func BenchmarkUncontendedSemaphore(b *testing.B) { s := new(uint32) *s = 1 HammerSemaphore(s, b.N, make(chan bool, 2)) } func BenchmarkContendedSemaphore(b *testing.B) { b.StopTimer() s := new(uint32) *s = 1
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jun 16 21:25:35 UTC 2022 - 5.9K bytes - Viewed (0)