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

Locking does not seem to work properly in Windows #38

Open
theicfire opened this issue Jul 30, 2019 · 2 comments
Open

Locking does not seem to work properly in Windows #38

theicfire opened this issue Jul 30, 2019 · 2 comments

Comments

@theicfire
Copy link

I've previously ran a piece of code in Windows that does the following

sess.BeginDataAccess()
...
sess.SendPacket(...)
...
sess.EndDataAccess()

This worked fine. I then later tried to do this on a Mac and found that there was lock contention. From the jrtplib code, it looks like there should be. SOURCES_LOCK is grabbed on BeginDataAccess and also grabbed in SendPacket.

My takeaway is that Windows isn't properly locking SOURCES_LOCK, whereas Mac is

Note that in both environments jThread is running and working (I know this because OnPollThreadStep is being called)

I haven't confirmed in a minimal example environment that this is an issue, so please feel free to close this if this isn't a detailed enough bug report.

@j0r1
Copy link
Owner

j0r1 commented Sep 1, 2019

SendPacket already locks the necessary structures, it's meant to be called outside the BeginDataAccess/EndDataAccess section.

@theicfire
Copy link
Author

I expect it would throw an error in Windows if it's called inside a BeginDataAccess/EndDataAccess section, but it does not. It does however in Linux.

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

2 participants