-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add shareable base class #289
Open
ehpor
wants to merge
18
commits into
develop
Choose a base branch
from
feature/shareable
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+557
−176
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
One for the header, one for the data/buffer.
e3a7280
to
f8d3123
Compare
@raphaelpclt @ivalaginja This is ready for your review now. I'll do some more testing of edge cases, but I do not see this changing anything significantly other than 1-2 lines here and there, if any. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a base class for all objects that are shared between processes. A shareable object has a shared state and a local state. The shared state is assumed to be in shared memory and is accessed by the shareable object using a pointer. The local state is internal to the shareable object. Shareable objects have
Create()
andOpen()
methods that take a pointer to that shared state to initialize or open. Note: this base class provides no methods for actually sharing this information between processes. That's the job of aSharedMemory
or other similar classes. It just formalizes the size and open methods, and provides an enum for all shareable types.This PR also adds an
Event
class that combines all other Event implementations into one single class. An Event allows you to wait using multiple methods, choosable at runtime. This will be useful for testing comparing synchronization methods in practice rather than only during tests (like I've been doing so far).The data stream is also changed to use two shared memory blocks per stream. The first one is for header information, communicating where each data frame is in the buffer. The second is the buffer where the actual data is stored. This allows us to support GPU shared memory in the future (since the header information should not be stored in GPU shared memory but rather on CPU shared memory. Therefore, two separate shared memory buffers is required.
Risk to existing testbeds: no risk. Everything should be refactor only, all modifications are C++ only with no side-effects leaking into Python code.