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

Callbacks should be called asynchronously #48

Closed francois-normandin closed 6 years ago

francois-normandin commented 6 years ago

An asynchronous wrapper call on the dynamically dispatched callbacks would ensure that no race conditions or mishandled errors can block the workflow.

Callback VIs (onStart, onStop, onCreated, etc.) can make recursive calls to dependencies, which might contain blocking conditions that cannot be terminated gracefully. If the callback is wrapped in an async method waiting for execution to complete, framework can enforce thread termination on error. (This mechanism should work for both byVal and byRef classes)

francois-normandin commented 6 years ago

I'm closing this feature and marking it as "Will not implement". I'm unsure of the value of this feature I proposed. One factor to consider is the blocking of root thread when launching asynchronously. This feature would be impacted by dialog boxes and the likes, creating uncertainty in timing and be very difficult to debug.