-
Notifications
You must be signed in to change notification settings - Fork 51
Can't get data after multiple sets #23
Copy link
Copy link
Open
Description
test code:
hmap := haxmap.New[int64, interface{}](32)
go func() {
var idx int64
for i := 1; i <= 300; i++ {
time.Sleep(time.Millisecond * 250)
idx++
hmap.Set(idx, idx)
idx++ // Accelerated progress
hmap.Set(idx, idx)
fmt.Println("new..........", idx-1, idx)
}
}()
go func() {
var idx int64 = 1
for {
if _, ok := hmap.Get(idx); ok {
fmt.Println("get_del...........", idx)
hmap.Del(idx)
idx++
}
time.Sleep(time.Millisecond * 10)
}
}()
time.Sleep(time.Hour)
After looping for a while, no more data is obtained
Development Environment: Windows10(x64), go1.19.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels