Skip to content

Only rescan the subtree that changed - #27

Open
robbiefish wants to merge 2 commits into
openDAQ:release/4.0from
hbkworld:fix/scoped-rescan-coreevent
Open

robbiefish wants to merge 2 commits into
openDAQ:release/4.0from
hbkworld:fix/scoped-rescan-coreevent

Conversation

@robbiefish

Copy link
Copy Markdown

Rescanning from the root while openDAQ holds the changed component's lock deadlocks against anything holding another device's lock.

Two threads deadlock on two different component locks:

Thread A (the caller)
connect signal to input port
-> function block's onConnected takes the function block's lock
-> adds a nested component
-> ComponentAdded core event
-> LT streaming server handler calls rescan()
-> rescan walks the whole instance from the root
-> blocks waiting for the device's lock

Thread B (the device acquisition thread)
holds the device's lock while sending a packet
-> packet is delivered to the function block (SameThread notification)
-> function block's onPacketReceived wants the function block's lock
-> blocks

A holds the function block lock and wants the device lock. B holds the device lock and wants the function block lock.

This PR scopes the core event handlers so they only look at what the event actually changed, instead of rescanning from the root.

Rescanning from the root while openDAQ holds the changed component's lock
deadlocks against anything holding another device's lock.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant