JKISoftware / JKI-State-Machine-Objects

Object-oriented framework for LabVIEW based on the JKI State Machine
BSD 3-Clause "New" or "Revised" License
95 stars 54 forks source link

Allow a standalone SMO to declare itself as shared dependency #45

Closed francois-normandin closed 6 years ago

francois-normandin commented 6 years ago

Currently, there is no mean to declare a subsystem as shared dependency without having an owner which manages the lifetime of the shared instance. Feature request is to allow a subsystem to self-declare itself as a shared dependency, by defining itself as owner. (Filtering should be done at start/stop methods to prevent recursive calls or doubling of instances.)

francois-normandin commented 6 years ago

image

Starting with version 1.3.0, SMO will be able to be declared as a shared resource from the Create method.

Behavior of this new feature:

using the Launch Dependency: image

using Statically-defined Dependencies: image

It is easy to prevent ownership transfer (build sharedKey using self-GUID + secretKey of Self), but unfortunately it leaves the issue of stopping and destroying the subsystem (managing its lifetime). How can we ensure that the right owner (the caller VI) is the only entity able to manage the lifetime or to delegate it? It requires adding an extra gizmo which cannot be handled automatically by the framework. IMO, it creates confusion and requires inside framework knowledge to use a simple feature.

francois-normandin commented 6 years ago

new feature in 1.3.0