-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actor API #52
base: master
Are you sure you want to change the base?
Conversation
see rtic-rs/rfcs#52 for details includes: core proposal and first `#[init]` extension Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
see rtic-rs/rfcs#52 for details includes: core proposal and `#[init]` and `memory-watermark` extensions Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Proof of Concept implementation: rtic-rs/rtic#537 |
Happy new year @rtic-rs/devs and congratulations on the 1.0 release] 🎉 . Would you now have bandwidth to consider this proposal? Should I rebase the linked PoC PR? |
In this weeks meeting we added as an action point to study this PoC, not sure if having it buildable is crucial for this first step |
see rtic-rs/rfcs#52 for details includes: core proposal and first `#[init]` extension Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
see rtic-rs/rfcs#52 for details includes: core proposal and `#[init]` and `memory-watermark` extensions Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
### Memory watermarks | ||
|
||
This extension proposes adding an API to retrieve the highest observed queue "occupancy": a *memory watermark* API. | ||
The goal is to be able to measure the actual memory usage of the message queues internally used by actors. | ||
|
||
> Side note: although the memory watermark feature is presented in the context of this actor proposal, a similar API could be added to regular software tasks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This functionality seems generally desired: rtic-rs/rtic#428
👍
This is a very interesting RFC. Would there be a chance to also add dynamic/runtime subscription and unsubscription to (many) message types? |
@mryndzionek an interesting idea. as this feature is pretty much based on RTIC's tasks and resources model, I think it would be possible to turn subscriptions on and off at runtime (effectively "masking" the dispatch of some software tasks), but you would need to declare upfront all the possible subscription you may enable at runtime (this is required by RTIC's compile-time guarantees). Such feature raises the question of what should happen if you send a message to which no actor is subscribed to -- in the current design that's a compiler error. That could be handled by simply dropping the message or raising an error; either is possible but what should be the behavior is a design question. At any rate, such a feature sounds a possible extension to the core actor feature proposed here. |
@japaric, I think this should be an error. Ignoring a message should be done explicitly. This is how it's done in similar systems (QPC, etc.). The only two things I'm missing right now in RTIC are the 'runtime' subscriptions and hierarchical state machines support. Both features are really useful. Hierarchical state machines can be added by an external crate, like Finny. Runtime subscriptions need however to be implemented directly in RTIC (to not be cumbersome to use, at least). |
comment from 'bradleyharden' on matrix -- answering here so the idea doesn't get lost in the matrix backlog
I think that could be modeled as an Actor that takes 2 types of messages. one type is DmaEvent sent by the hardware task. the hardware task only forwards DmaEvents to the actor and only needs read-access to the DMA status register. The actor owns the rest of DMA registers and starts and manages transfers. the other type of message is |
Trying to digest the discussion. The idea would be to have the set of listeners to be dynamic, which would benefit both clarity (moving some logic to the framework) and efficiency (since the actor would not need to be invoked and later just ignore). Sounds reasonable. One thought: would make sense to be able to dynamically instantiate new listeners (given that we have some backing allocator like heapless). Useful e.g., if want do implement a server, that can keep a number of connections up. Of course one could pre-allocate the maximum set of listeners, but maybe it would "feel" more natural to allocate/free listeners programatically. |
see rtic-rs/rfcs#52 for details includes: core proposal and first `#[init]` extension Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
see rtic-rs/rfcs#52 for details includes: core proposal and `#[init]` and `memory-watermark` extensions Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
see rtic-rs/rfcs#52 for details includes: core proposal and first `#[init]` extension Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
see rtic-rs/rfcs#52 for details includes: core proposal and `#[init]` and `memory-watermark` extensions Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
see rtic-rs/rfcs#52 for details includes: core proposal and `#[init]` and `memory-watermark` extensions Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
see rtic-rs/rfcs#52 for details includes: core proposal and first `#[init]` extension Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
see rtic-rs/rfcs#52 for details includes: core proposal and `#[init]` and `memory-watermark` extensions Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
see rtic-rs/rfcs#52 for details includes: core proposal and first `#[init]` extension Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Hello @rtic-rs/devs!
We (Ferrous Systems) have a working proof of concept (that needs some cleanup) for this feature but wanted to start a discussion around it with an RFC before throwing a lot of code at you. (actually, the RFC may be longer than the implementation 😅)
@perlindgren there might be some similarities here (minus the nice graphs) with the concurrent reactive objects / components idea we discussed a while ago.
Rendered text