3 ms·
thanks for the reply! > In C++ you can make ownership objects (in the vein of unique_ptr) that automagically track the lifetime of DMA references. does that r
by andrekandre 6y ago
thanks for the reply!
> In C++ you can make ownership objects (in the vein of unique_ptr) that automagically track the lifetime of DMA references.
does that require os support to make it work? i assume the tracking is handled by some specific inturrupts?
> You can make all of this work in Rust by using a lot of "unsafe" and inelegant data structure workarounds but it voids most of the safety benefits of Rust and requires more complex code.
i see... so i guess rust would have to take one small step out of static, and into dynamic territory with a smart pointer "trait"?
- jandrewrogers 6y agoThe OS has to provide syscalls and other APIs for scheduling DMA operations into your address space. Linux has supported this to some degree for a very long time (storage DMA was introduced in the 2.5 kernels). In terms of behavior and APIs, storage is very different than network, since the former is schedule-driven and the latter is interrupt-driven. There is a lot of implementation detail, but you need object references that are aware when a DMA operation is outstanding on address space they “own”, the type of DMA operation, and rules about when new DMA operations can be scheduled with respect to object reference lifecycles. There are no fixed set of rules but there are a common set of design patterns. The scheduler design does a lot of the heavy lifting.
- andrekandre 6y agoi see, very interesting, thanks ^^