Open imyxh opened 2 months ago
I guess the multiple states part is trivial to implement, since the GSL objects don't store data themselves.
But coordinating the underlying storage for each state (each block of the state? nomenclature TBD ...) to lie on the shm without copying is much more annoying, since part of what makes coding for anyloop so elegant is that the state is just a pointer to the device's own data. In fact, many devices don't even have control over where the memory they use is allocated. So in this case you always have to copy at least once if you want IPC. Maybe we just deal with copying and implement a anyloop:copy_to_shm
device?
I don't think it's worth tackling these more niche problems until we have an actual use case for them. But I wanted to write out my thoughts for when it does come up.
For now, the only actual annoyance we've experienced is the Julia blocking issue, which could be fixed by:
anyloop:copy_to_shm device
header.status
as a mutexAnd in the future when multiple states (banks? blocks?) are implemented then copy_to_shm
can just take a parameter to select the source.
I guess the device can just be anyloop:shm
, and can take care of creating the shm object too. Then a source
parameter can tell it whether to copy from the shm instead of to it.
So, two related things:
My current proposal is to fix both of these issues by using proper
mmap
ed shared memory. There are a few considerations for this, however: