demikernel
demikernel copied to clipboard
[catnap] Allow chained DemiBuffers buffers for push and pop
This is a draft to discuss approach.
Add a next method to DemiBuffer which will instantiate a new DemiBuffer for the next chained buffer (if any such buffer is present). Allow chained buffers in Windows catnap push/pop operations.
There are some issues with the approach as stated:
- There is no way to chain buffers currently.
- Assume we have some
chainorappendmethod onDemiBuffer. This method must consume the buffer being chained to be consistent with other support functions. Specifically,clone, which will fork the MetaData for a buffer to avoid having more than one mutable view of a DemiBuffer. - The mutable/reference semantics are not correct. Currently, a user may call
nextmore than once on the same DemiBuffer. Since DemiBuffer is a reference to MetaData, this allows mutliple mutable references.
I'm going to reverse my position: DemiBuffer should wrap the entire buffer chain, rather than an individual chunk. This would make solving reference issues much simpler.
Also, I didn't do any testing yet :)