T
twostars
Replace shared memory with Boost.Interprocess (#621)
* Replace shared memory queue with boost::interprocess::message_queue
Aujard:
This previously tried to detect if Ebenezer dropped via the process ID in the queue,
and triggered saves if it wasn't found (which really didn't work at all).
This has been replaced with a heartbeat; Ebenezer will periodically send a heartbeat.
Instead of checking to see if the process exists, we now check the time since the last
heartbeat was received.
Ebenezer:
Use a mutex to guard access to region buffers; this previously shared SMQ defines and the
SMQ's "locking" implementation which really wasn't thread-safe at all.
This can be simplified to just a basic mutex, and we can throw away the SMQ defines.
* Rename CSharedMemQueue -> SharedMemoryQueue
* Add SharedMemoryBlock to replace _USER_DATA MMF
This uses the raw internal type shared_memory_object.
This is a more direct translation than I was initially considering,
but it's the simplest and most straightforward for now.
Ideally we'd use managed_shared_memory and allocate our blocks there,
using it to setup more complex types, so we could use containers like maps.
For now this suffices as a fairly direct translation from raw MMF to
cross-platform Boost.Interprocess support.
* Client.sln: Add fetch-boost dependency
* Aujard: Strip retry logic
Instead, let the queue handle it internally (like it always did for Ebenezer).
* Ebenezer: Handle region buffer send/flushes more consistently
Now that it has a mutex of its own, it doesn't need to use the socket's mutex.
Additionally, we shift the length check to be handled under the mutex, during the fetch,
so we can ensure state is consistent, rather than potentially send an "empty" packet.
* SharedMemoryBlock: Don't update our instance until everything is loaded
If any step fails, it shouldn't be loaded at all.
Github Commit Görüntüle...
See Commints...
..
* Replace shared memory queue with boost::interprocess::message_queue
Aujard:
This previously tried to detect if Ebenezer dropped via the process ID in the queue,
and triggered saves if it wasn't found (which really didn't work at all).
This has been replaced with a heartbeat; Ebenezer will periodically send a heartbeat.
Instead of checking to see if the process exists, we now check the time since the last
heartbeat was received.
Ebenezer:
Use a mutex to guard access to region buffers; this previously shared SMQ defines and the
SMQ's "locking" implementation which really wasn't thread-safe at all.
This can be simplified to just a basic mutex, and we can throw away the SMQ defines.
* Rename CSharedMemQueue -> SharedMemoryQueue
* Add SharedMemoryBlock to replace _USER_DATA MMF
This uses the raw internal type shared_memory_object.
This is a more direct translation than I was initially considering,
but it's the simplest and most straightforward for now.
Ideally we'd use managed_shared_memory and allocate our blocks there,
using it to setup more complex types, so we could use containers like maps.
For now this suffices as a fairly direct translation from raw MMF to
cross-platform Boost.Interprocess support.
* Client.sln: Add fetch-boost dependency
* Aujard: Strip retry logic
Instead, let the queue handle it internally (like it always did for Ebenezer).
* Ebenezer: Handle region buffer send/flushes more consistently
Now that it has a mutex of its own, it doesn't need to use the socket's mutex.
Additionally, we shift the length check to be handled under the mutex, during the fetch,
so we can ensure state is consistent, rather than potentially send an "empty" packet.
* SharedMemoryBlock: Don't update our instance until everything is loaded
If any step fails, it shouldn't be loaded at all.
Github Commit Görüntüle...
See Commints...
..