Skip to content

Conversation

@rneswold
Copy link
Contributor

This fixes the logic block start-up bug.

rneswold added 5 commits June 24, 2025 19:59
There was a race condition when bringing up the logic blocks. The
`tod` and `solar` tasks will exit when they have no clients. A handle
to their broadcast channel is cloned and given to each logic block as
it starts up. There is a small chance that, before the first logic
block registers for these event, the `tod` or `solar` tasks will check
how many clients they have and see that it's zero and exit.

This commit uses `sync::Barrier` as a synchronization point so the
`tod` and `solar` tasks check their number of clients after every
logic block has initialized.

A Barrier is also passed to each logic block so the for-loop won't
proceed until the currently started logic block has registered for
`tod` or `solar` events.
Hopefully this shortens compile and link times.
This code was in a `select!` block so the formatter doesn't touch it.
Now the "driver" spans exists for the life of the driver. The "init"
span gets added during initialization.
@rneswold rneswold linked an issue Jun 25, 2025 that may be closed by this pull request
@rneswold rneswold merged commit ee7ad33 into DrMemCS:main Jun 25, 2025
3 checks passed
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.

🐛 The time-of-day task exited when it shouldn't have

1 participant