-
Notifications
You must be signed in to change notification settings - Fork 22
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
Lifecycle improvements #47
base: develop
Are you sure you want to change the base?
Commits on Aug 16, 2023
-
Executors should allow for more flexibility and encapsulation. create mode 100644 src/ros2cs/ros2cs_core/interfaces/IExecutor.cs
Configuration menu - View commit details
-
Copy full SHA for 13a4d04 - Browse repository at this point
Copy the full SHA 13a4d04View commit details -
refactor Node and create Context
- Context is a non-static version of Ros2cs without executor functionality - Context and Node are now sealed - Node is now internal and is preventing its Context from being collected by the GC - not calling Dispose may now leak resources since internal collections may be finalized in the finalizer - sizes of rcl_node_t and rcl_conext_t are now invisible to C# code create mode 100644 src/ros2cs/ros2cs_core/Context.cs delete mode 100644 src/ros2cs/ros2cs_core/Ros2cs.cs create mode 100644 src/ros2cs/ros2cs_core/interfaces/IContext.cs create mode 100644 src/ros2cs/ros2cs_core/utils/MappingValueView.cs
Configuration menu - View commit details
-
Copy full SHA for 8c580c2 - Browse repository at this point
Copy the full SHA 8c580c2View commit details -
improve description of IExtendedDisposable.IsDisposed
This should prevent misunderstandings regarding being in an disposed state and being disposed successfully.
Configuration menu - View commit details
-
Copy full SHA for 3f53085 - Browse repository at this point
Copy the full SHA 3f53085View commit details -
- is now sealed and internal - rcl_publisher_t size is now invisible to C# code - removes himself from node on dispose - prevents Node from being collected by the GC
Configuration menu - View commit details
-
Copy full SHA for 51495c2 - Browse repository at this point
Copy the full SHA 51495c2View commit details -
This interface contains all methods necessary for executors to process work. The async version is equivalent to the non-async version and an optimization opportunity for task based executors. create mode 100644 src/ros2cs/ros2cs_core/interfaces/IWaitable.cs
Configuration menu - View commit details
-
Copy full SHA for 5ce3a79 - Browse repository at this point
Copy the full SHA 5ce3a79View commit details -
- is now sealed and internal - rcl_subscription_t size is now invisible to C# code - removes himself from node on dispose - prevents Node from being collected by the GC
Configuration menu - View commit details
-
Copy full SHA for a2c32d5 - Browse repository at this point
Copy the full SHA a2c32d5View commit details -
- is now sealed and internal - rcl_service_t size is now invisible to C# code - removes himself from node on dispose - prevents Node from being collected by the GC
Configuration menu - View commit details
-
Copy full SHA for 40f53d9 - Browse repository at this point
Copy the full SHA 40f53d9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7858e3d - Browse repository at this point
Copy the full SHA 7858e3dView commit details -
rename MappingValueView -> MappedValueDictionary
rename src/ros2cs/ros2cs_core/utils/{MappingValueView.cs => MappedValueDictionary.cs} (87%)
Configuration menu - View commit details
-
Copy full SHA for d314def - Browse repository at this point
Copy the full SHA d314defView commit details -
create mode 100644 src/ros2cs/ros2cs_core/utils/LockedDictionary.cs
Configuration menu - View commit details
-
Copy full SHA for c3fbc80 - Browse repository at this point
Copy the full SHA c3fbc80View commit details -
Configuration menu - View commit details
-
Copy full SHA for 33d3be0 - Browse repository at this point
Copy the full SHA 33d3be0View commit details -
- is now sealed and internal - rcl_client_t size is now invisible to C# code - removes himself from node on dispose - prevents Node from being collected by the GC - reduced code duplication
Configuration menu - View commit details
-
Copy full SHA for 4a24200 - Browse repository at this point
Copy the full SHA 4a24200View commit details -
These assertions are only enabled in debug mode and should make finding bugs easier.
Configuration menu - View commit details
-
Copy full SHA for dabf904 - Browse repository at this point
Copy the full SHA dabf904View commit details -
add calls to
GC.KeepAlive(this)
This should prevent the GC from starting finalization while a native call is running.
Configuration menu - View commit details
-
Copy full SHA for d6b5e72 - Browse repository at this point
Copy the full SHA d6b5e72View commit details -
add internal Removal methods to
Node
This enforces more encapsulation than direct internal access.
Configuration menu - View commit details
-
Copy full SHA for 83a2a2b - Browse repository at this point
Copy the full SHA 83a2a2bView commit details -
Make setting `INode.Executor` the task of the executor since `INode.SwapExecutor` is performing two actions at once (adding and removing) which can complicate error handling. Furthermore, `IExecutor.Wake` is split to allow notifying executors that changes occurred without being forced to wait.
Configuration menu - View commit details
-
Copy full SHA for 0fd008a - Browse repository at this point
Copy the full SHA 0fd008aView commit details -
update tests and fix C interop
Returning false could fail since the size of a bool is different between C, C++ and C#. This is fixed by adding wrappers which assure that a byte is returned containing 1 for true and 0 for false. Furthermore this commit adds missing attributes to ref parameters in NativeRcl or turns them into out parameters.
Configuration menu - View commit details
-
Copy full SHA for 667f68f - Browse repository at this point
Copy the full SHA 667f68fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 561ec07 - Browse repository at this point
Copy the full SHA 561ec07View commit details -
This allows wrappers to be put in a wait set by delegating to the wrapped implementation.
Configuration menu - View commit details
-
Copy full SHA for 3a16827 - Browse repository at this point
Copy the full SHA 3a16827View commit details -
- allow for checking which resources became ready - implement IExtendedDisposable and IReadOnlyCollection interfaces - abstract away wait set resizing and filling - hide struct behind IntPtr and C wrappers to handle layout changes and GC moves
Configuration menu - View commit details
-
Copy full SHA for 11c3696 - Browse repository at this point
Copy the full SHA 11c3696View commit details -
It is currently only internal and used for the executor.
Configuration menu - View commit details
-
Copy full SHA for 2a42d14 - Browse repository at this point
Copy the full SHA 2a42d14View commit details -
- implementation of IExecutor which has to be spun manually - roughly the same as the old spin logic in Ros2cs - does not rescan every spin create mode 100644 src/ros2cs/ros2cs_core/executors/ManualExecutor.cs create mode 100644 src/ros2cs/ros2cs_tests/src/ManualExecutorTest.cs
Configuration menu - View commit details
-
Copy full SHA for bc73ca7 - Browse repository at this point
Copy the full SHA bc73ca7View commit details -
doc and tests updates for guard condition behavior
Guard conditions seem to stay triggered until waited on.
Configuration menu - View commit details
-
Copy full SHA for c635d56 - Browse repository at this point
Copy the full SHA c635d56View commit details -
remove redundant
IsDisposed
checksThe checks are already done by rcl.
Configuration menu - View commit details
-
Copy full SHA for b1594c1 - Browse repository at this point
Copy the full SHA b1594c1View commit details -
improve Context documentation on thread safety
Creating nodes is now thread safe.
Configuration menu - View commit details
-
Copy full SHA for 8adf7e5 - Browse repository at this point
Copy the full SHA 8adf7e5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 802dc40 - Browse repository at this point
Copy the full SHA 802dc40View commit details -
improve Publisher documentation
The class is now public to allow users to read the implementation documentation like thread safety. To prevent access to internal methods the class remains sealed and uses explicit interface implementations.
Configuration menu - View commit details
-
Copy full SHA for acb813f - Browse repository at this point
Copy the full SHA acb813fView commit details -
improve Subscription documentation
The class is now public to allow users to read the implementation documentation like thread safety. To prevent access to internal methods the class remains sealed and uses explicit interface implementations.
Configuration menu - View commit details
-
Copy full SHA for 2f72a51 - Browse repository at this point
Copy the full SHA 2f72a51View commit details -
The class is now public to allow users to read the implementation documentation like thread safety. To prevent access to internal methods the class remains sealed and uses explicit interface implementations.
Configuration menu - View commit details
-
Copy full SHA for 4535da3 - Browse repository at this point
Copy the full SHA 4535da3View commit details -
The class is now public to allow users to read the implementation documentation like thread safety. To prevent access to internal methods the class remains sealed and uses explicit interface implementations.
Configuration menu - View commit details
-
Copy full SHA for 1d6cc1d - Browse repository at this point
Copy the full SHA 1d6cc1dView commit details -
The class is now public to allow users to read the implementation documentation like thread safety. Furthermore, the primitive collections (and by extension their methods) are now thread safe.
Configuration menu - View commit details
-
Copy full SHA for 9bcafbd - Browse repository at this point
Copy the full SHA 9bcafbdView commit details -
remove
IWaitable.TryProcessAsync
Async operations are out of scope for this branch.
Configuration menu - View commit details
-
Copy full SHA for cd161f0 - Browse repository at this point
Copy the full SHA cd161f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1e51b52 - Browse repository at this point
Copy the full SHA 1e51b52View commit details -
make
Node.Executor
thread safeThis commit prevents node primitives from waiting on the wrong executor while being disposed.
Configuration menu - View commit details
-
Copy full SHA for 4a4f19b - Browse repository at this point
Copy the full SHA 4a4f19bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7556027 - Browse repository at this point
Copy the full SHA 7556027View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2fbfeae - Browse repository at this point
Copy the full SHA 2fbfeaeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 89aaf68 - Browse repository at this point
Copy the full SHA 89aaf68View commit details -
This should be more user friendly than `ManualExecutor.Spin`.
Configuration menu - View commit details
-
Copy full SHA for c89ea26 - Browse repository at this point
Copy the full SHA c89ea26View commit details -
Configuration menu - View commit details
-
Copy full SHA for f4ce8ae - Browse repository at this point
Copy the full SHA f4ce8aeView commit details -
add copyright notices to new files
Files created by this PR are under the copyright of ADVITEC Informatik GmbH as suggested by review. The license is the same as existing files.
Configuration menu - View commit details
-
Copy full SHA for c248106 - Browse repository at this point
Copy the full SHA c248106View commit details -
Configuration menu - View commit details
-
Copy full SHA for 38e0534 - Browse repository at this point
Copy the full SHA 38e0534View commit details -
Configuration menu - View commit details
-
Copy full SHA for f062a98 - Browse repository at this point
Copy the full SHA f062a98View commit details -
dispose guard conditions after invoking
IContext.OnShutdown
This prevents violating the documentation.
Configuration menu - View commit details
-
Copy full SHA for 52a331d - Browse repository at this point
Copy the full SHA 52a331dView commit details -
dispose wait set after invoking
IContext.OnShutdown
This prevents violating the documentation.
Configuration menu - View commit details
-
Copy full SHA for 3530611 - Browse repository at this point
Copy the full SHA 3530611View commit details -
Add executor spinning in the background
To prevent users from having to implement the feature themselves and provide an alternative to the old spinning behaviour. The new executor uses a long running `Task` instead of a `Thread` to provide better integration with the C# ecosystem.
Configuration menu - View commit details
-
Copy full SHA for 2e5bdd9 - Browse repository at this point
Copy the full SHA 2e5bdd9View commit details
Commits on Sep 1, 2023
-
fix thread starvation in
ManualExecutor.*Wait
Threads may fail to wake for some time since the method waits on a `ManualResetEventSlim` which is reset before the next spin. To prevent such cases the waiting condition has been modified to additionally check an integer which is incremented after every spin to detected if the spin which was waited upon has ended.
Configuration menu - View commit details
-
Copy full SHA for 77bfffd - Browse repository at this point
Copy the full SHA 77bfffdView commit details