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

Process Sync does not wait for State started to release #84

Closed francois-normandin closed 2 years ago

francois-normandin commented 2 years ago

Describe the bug Process Sync does not wait for State started to release

To Reproduce Steps to reproduce the behavior:

  1. Wait for process sync in SMO Process VI
  2. Launch dynamically a dependency (SMO) right afterwards. The SMO might not be started at this point although Process has synced.

Expected behavior Process Sync should mark the point in time when the SMO has been started, not when the current process has reported it is ready to start.

Screenshots There is a time gap between the signal from the child process and the time when the SMO changes state. This causes a race condition that forces developers to check the state is started before performing tasks. image

Additional context It would be nice to have a flag on the Process Sync method that forces to wait for "Started" and that this flag be TRUE by default. It already waits for Stopped on synching during the teardown, so this is the expected default condition. However, it might be OK to skip waiting in the Process.vi on startup, IF it is fine for a process to perform other non-critical tasks while the state transitions. This should be a conscious (and documented) choice by the developer...

francois-normandin commented 2 years ago

build 1.4.0.68 fixes this issue (Unit test created to verify)