demikernel icon indicating copy to clipboard operation
demikernel copied to clipboard

[catnap] Allow chained DemiBuffers buffers for push and pop

Open kyleholohan opened this issue 1 year ago • 0 comments

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 chain or append method on DemiBuffer. 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 next more 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 :)

kyleholohan avatar Jan 22 '24 23:01 kyleholohan