On Thu, Jan 12, 2017 at 5:54 AM, Jason Dillaman <jdillama@xxxxxxxxxx> wrote: > There is option (3) which is to have a new (or modified) > "buffer::create_static" take an optional callback to invoke when the > buffer::raw object is destructed. The raw pointer would be destructed > when the last buffer::ptr / buffer::list containing it is destructed, > so you know it's no longer being referenced. > > You could then have the new C API methods that wrap the C buffer in a > bufferlist and set a new flag in the librados::AioCompletion to delay > its completion until after it's both completed and the memory is > released. When the buffer is freed, the callback would unblock the > librados::AioCompltion completion callback. I much prefer an approach like this: it's zero-copy; it's not a lot of user overhead; but it requires them to explicitly pass memory off to Ceph and keep it immutable until Ceph is done (at which point they are told so explicitly). Even if we were very careful about not returning to users until operations are done, just taking buffers into a multi-threaded application without having explicit markers about ownership is a recipe for misuse. -Greg _______________________________________________ ceph-users mailing list ceph-users@xxxxxxxxxxxxxx http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com