From 300953f78cbd5a739c24cda572d5802cd3c37846 Mon Sep 17 00:00:00 2001 From: Yiling-J Date: Wed, 2 Oct 2024 16:44:12 +0800 Subject: [PATCH] test --- seqlock/seq_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/seqlock/seq_test.go b/seqlock/seq_test.go index a388b20..e758b73 100644 --- a/seqlock/seq_test.go +++ b/seqlock/seq_test.go @@ -87,6 +87,7 @@ func New[K comparable, V any](key K, value V) *Node[K, V] { func reader(node *Node[int, int], num_iterations int, cdone chan bool) { for i := 0; i < num_iterations; i++ { + fmt.Print(".") vn := node.Value() if vn != 0 { panic(fmt.Sprintf("wlock(%d)\n", vn)) @@ -97,6 +98,7 @@ func reader(node *Node[int, int], num_iterations int, cdone chan bool) { func writer(node *Node[int, int], num_iterations int, done atomic.Bool) { for !done.Load() { + fmt.Print("x") node.Lock() node.SetValue(1) node.SetValue(2) @@ -127,5 +129,5 @@ func HammerRWMutex(numReaders, num_iterations int) { } func TestNode_Seqlock(t *testing.T) { - HammerRWMutex(100, 5000000) + HammerRWMutex(50, 5000000) }