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 message_queue with windows_shared_memory #211

Open
Nerixyz opened this issue Mar 3, 2024 · 0 comments
Open

Using message_queue with windows_shared_memory #211

Nerixyz opened this issue Mar 3, 2024 · 0 comments

Comments

@Nerixyz
Copy link

Nerixyz commented Mar 3, 2024

We're currently using message_queue on Windows, but want to avoid files being created on the user's filesystem (even in the application's config/cache directory). Moreover, we'd like to have the semantics of windows_shared_memory (mostly the destruction once all handles to the memory are closed).

Currently, message_queue uses shared_memory_object. Would it be possible for users to specify the underlying abstraction (e.g. message_queue_t<offset_ptr<void>, windows_shared_memory>)?

I experimented a bit by using managed_open_or_create_impl<windows_shared_memory, 0, false, false>, which worked fine for me (I might have missed some bugs as I don't know IPC too well). One downside is that message_queue_t::remove can't be used with windows_shared_memory, as it doesn't provide that functionality (the documentation for ~message_queue_t should be updated, too).

I'd be fine if this was done via a #define, but it would be nicer if an approach similar to the previously mentioned could be taken.
If this is something that could get included in the library, I'd be fine with implementing it.

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

1 participant