boostorg / boostorg/interprocess

Using `message_queue` with `windows_shared_memory`

Offen
#211 0 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C++
Sterne
185
Forks
131
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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, windows_shared_memory>`)?

I experimented a bit by using `managed_open_or_create_impl`, 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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne mit dem Lesen von message_queue_t und seiner derzeitigen Verwendung von shared_memory_object; vergleiche dann managed_open_or_create_impl mit windows_shared_memory. Ermittle, wie die zugrunde liegende Speicherabstraktion ausgewählt werden könnte und wie die Semantik der Zerstörung und von message_queue_t::remove funktionieren sollte; aktualisiere die Dokumentation des Destruktors, wenn der Entwurf akzeptiert wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp
Bereich
operating-systems
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
28/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.