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

Using socket.bind as a mutex doesn't work on Windows #402

Open
hepiyellow opened this issue Mar 30, 2023 · 1 comment
Open

Using socket.bind as a mutex doesn't work on Windows #402

hepiyellow opened this issue Mar 30, 2023 · 1 comment

Comments

@hepiyellow
Copy link

hepiyellow commented Mar 30, 2023

Hi,

I am using socket.bind() to implement a mutex, and protect data from begin accessed by multiple thread at the same time.
It works well on Mac, but on Windows 10 I see that multiple threads are binding successfully at the same time (before the first thread closes the socket)

I see that the bind() implementation uses the socket.core's bind() method.

  1. Is there a known issue on Windows?
  2. Should use the socket.core's bind() directly?
@alerque
Copy link
Member

alerque commented Mar 30, 2023

I'm afraid I do not use or even have access to a Windows machine to test this or suggest a fix. There are some Windows users around so hopefully somebody else can chime in.

If it does turn out there is a problem with the library on Windows I'd be happy to facilitate a PR getting merged if somebody in the know contributes a fix.

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

No branches or pull requests

2 participants