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

infinite waiting #226

Open
Yanjiachan opened this issue Aug 1, 2024 · 3 comments
Open

infinite waiting #226

Yanjiachan opened this issue Aug 1, 2024 · 3 comments

Comments

@Yanjiachan
Copy link

Yanjiachan commented Aug 1, 2024

When using a message_queue, if a process exits or crashes and then restarts, it can cause another process to enter into an infinite wait state.
waiting at:
p_hdr->m_cond_send.notify_one();

@igaztanaga
Copy link
Member

This is a known issue, if your platform does not support robust synchronization primitives there is no possible correct emulation. You can define BOOST_INTERPROCESS_ENABLE_TIMEOUT_WHEN_LOCKING, so that waits longer than BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS (10.000 milliseconds by default) will return error.

What platform are you using? Windows?

@Yanjiachan
Copy link
Author

Thanks for your reply, I am using message_queue on linux.
Is there any relevant documentation about these macro definitions?

@igaztanaga
Copy link
Member

Sadkly, there is no public information that's why I will left this bug open until I document it. In any case, since you are using Linux, starting from Boost 1.78, the implementation should use Robust Mutexes (see #65) , so you should not have these infinite loop problems. Which Boost version are you using?

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