Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get data after multiple sets #23

Open
bwb0101 opened this issue Nov 21, 2022 · 6 comments
Open

Can't get data after multiple sets #23

bwb0101 opened this issue Nov 21, 2022 · 6 comments

Comments

@bwb0101
Copy link

bwb0101 commented Nov 21, 2022

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

@alphadose
Copy link
Owner

@jkingben let me try that snippet on my own windows PC and then get back to you

@franchb
Copy link

franchb commented Dec 6, 2022

Confirmed the same behavior on Linux, amd64 go 1.19.3

@nmtx-2022
Copy link

I am also, MacOS 13.0.1 M1

@alphadose
Copy link
Owner

Understood, I will try to fix this in the coming weekend

@nmtx-2022
Copy link

Is there any new progress?

@alphadose
Copy link
Owner

Sorry I haven't had much time recently to fix these issues due to my job. But coming this weekend I will definitely devote time and try to fix this and then publish a new release. Once again, apologies for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants