<mkj[m]>
<JamesMunns[m]> "I handle this in bbq, IMO the..." <- yeah, that's probably what I should be doing. not having a lifetime on handles is nice though (a bit at the expense of moving some checks to runtime vs compile time). at the moment I pass handles across a Channel, which would probably tricky. that said, those channels must have a lifetime shorter than the Core, so maybe I can sort something out...
<JamesMunns[m]>
mkj[m]: Bbqueue has a lifetime, but for most embedded users the storage is a static, so they can leave off the lifetime annotation or just alias it to 'static
<mkj[m]>
my Handles are used to fetch a mutable borrowed item from the Core, so that would have problems with multiple callers working concurrently
<JamesMunns[m]>
mkj[m]: If you hold a reference or pointers to the storage, you should bind it to the lifetime of the storage anyway to avoid use after frees
<JamesMunns[m]>
You can have a shared phantomdata lifetime with inner mutability
<mkj[m]>
using an inner mutex on core or something?
<JamesMunns[m]>
(This is so what bbqueue does)
<JamesMunns[m]>
It depends. Bbqueue is spsc so it uses atomics to gate access
<JamesMunns[m]>
If you have multiple nodes, you may need a mutex to "alloc" or "free", yes. It depends
<mkj[m]>
ok right, yeah I've been using similar to that in some other parts. will have a look at what bbqueue is doing, thanks
<JamesMunns[m]>
Depends on how you design the data structure
<JamesMunns[m]>
Might be worth looking at some of the embassy sync collections too, like pundit
<JamesMunns[m]>
s/pundit/pubsub/
<mkj[m]>
(googling for "embassy pundit" was failing badly!)
<JamesMunns[m]>
Trying to chat with autocorrect :p
<mkj[m]>
<JamesMunns[m]> "If you hold a reference or..." <- this is all safe code, so it'll "just" be "caller gets an error" or "ran ou tof handles" if a handle is passed late/to the wrong core. so not ideal, but not fatal.
<Vaishnav-sabari->
<jannic> "Beginner questions are welcome..." <- > <@jannic:matrix.org> Beginner questions are welcome as they help us to learn where documentation could be improved!
<Vaishnav-sabari->
> If you know rust and are curious about embedded, https://docs.rust-embedded.org/discovery-mb2/ likely is the right book to read. It is continuously being improved, so feedback on that is welcome as well, especially if you are new to the topic. (Assuming this is not the book you meant by "the embedded book". If it is, what do you think it's missing most?)
<Vaishnav-sabari->
Understood. Thank you. Will be sure to take a look at it.
sroemer has joined #rust-embedded
wassasin[m] has quit [Quit: Idle timeout reached: 172800s]
pcs38 has joined #rust-embedded
<Vaishnav-sabari->
<jannic> "Beginner questions are welcome..." <- > <@jannic:matrix.org> Beginner questions are welcome as they help us to learn where documentation could be improved!
<Vaishnav-sabari->
> If you know rust and are curious about embedded, https://docs.rust-embedded.org/discovery-mb2/ likely is the right book to read. It is continuously being improved, so feedback on that is welcome as well, especially if you are new to the topic. (Assuming this is not the book you meant by "the embedded book". If it is, what do you think it's missing most?)
<Vaishnav-sabari->
To answer the question about which book I mentioned , I was mentioning the one in that stm32discovery board . Thank you.
Ralph[m] has quit [Quit: Idle timeout reached: 172800s]
<FreeKill[m]>
Still playing about with postcard-rpc... But got a more general rust question out of it.
<FreeKill[m]>
Is there a convenient way to say "I want whatever version of embassy-sync my deps use". Cos right now I'm having to manually specifiy the same versions of things that postcard-rpc happens to use, which feels very fragile
AlexandervanSaas has quit [Quit: Idle timeout reached: 172800s]
pcs38 has quit [Remote host closed the connection]