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

Per-socket multi-thread safety #46

Open
m-ronnblom opened this issue Nov 5, 2021 · 0 comments
Open

Per-socket multi-thread safety #46

m-ronnblom opened this issue Nov 5, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@m-ronnblom
Copy link
Collaborator

Add per-socket multi-thread safety, to allow for example:

  1. one receiving and one or more sending threads (both blocking from the threads' point of view) acting on the same XCM socket.
  2. allow gracefully terminating a thread waiting (in blocking mode) on xcm_receive() from another thread, by using xcm_close().

The implementation would probably include a POSIX mutex and the use of an XCM socket-internal pipe (or similar) to allow blocking threads to be woken up/notified.

In current XCM, an application that let multiple threads interact with the same socket need to add a wrapper to do roughly the above to work with XCM sockets, or solve this problem in some other way (e.g., to relay messages on an MT safe, process-internal communication channel).

@m-ronnblom m-ronnblom added the enhancement New feature or request label Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant