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

Improved concurrency and thread-safeness in Mailbox #939

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

fbacchella
Copy link
Contributor

Simplified Mailbox, always thread safe, so MailboxSafe usages are removed and the class is marked at deprecated.

@trevorbernard
Copy link
Member

Since Sockets are known to be to be not thread safe, what is the purpose if making internals thread safe? It might the case we're adding extra work for no material gain.

@trevorbernard
Copy link
Member

This PR satisfies all c4 requirements so I must merge but it's worth considering my question. I do not know the answer.

@fbacchella
Copy link
Contributor Author

fbacchella commented Jan 16, 2023

Mailbox was using YPipe, a class that is really complicated to understand and ensure to be correct. It this class could be totally removed, it would be really better for reliability of jeromq. I’m also investigating #905, and especialy #905 (comment) and I’m chasing down many occurrence of non compliance of java memory model, where a non-protected or non volatile variable could be access with wrong values.

The original author was not totally sure of thread usage, as he added some lock. Either they are to be removed, or the class made thread safe. I choose the way that open the most usage.

MailboxSafe was handling concurrency in a custom way, using a standard class should improve reliability too.

@trevorbernard trevorbernard merged commit 4387bed into zeromq:master Jan 16, 2023
@fbacchella fbacchella deleted the simple_mailbox branch January 16, 2023 19:22
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

Successfully merging this pull request may close these issues.

2 participants