You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm hoping to write a custom BufferedBidirectionalStreamBuf that uses a custom buffering strategy. I'm hoping to wrap llfio (specifically llfio::file_handle), but the problem is that it uses functions like readv(2)/preadv(2)/preadv2(2)) (or Windows's equivalents) which means scatter/gather IO. Which can be incredible performance-wise, but it needs a bit of work to actually wrap into an iostream. I thought I could just do this but then I looked at the code for BufferedBidirectionalStreamBuf and apparently it allocates its own internal buffer. I... Guess this makes my job easier.... Should I just use that allocated buffer or should I override the constructor to do my own thing? My buffering strategy involves a buffer list for reading and writing, with each buffer being the page size of the system in question. When the buffer is filled, it flushes it all to disk. So essentially I'd be taking over the normal role of the FS cache (in a way) and bypassing it altogether.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all,
I'm hoping to write a custom
BufferedBidirectionalStreamBuf
that uses a custom buffering strategy. I'm hoping to wrapllfio
(specificallyllfio::file_handle
), but the problem is that it uses functions likereadv(2)/preadv(2)/preadv2(2)
) (or Windows's equivalents) which means scatter/gather IO. Which can be incredible performance-wise, but it needs a bit of work to actually wrap into an iostream. I thought I could just do this but then I looked at the code forBufferedBidirectionalStreamBuf
and apparently it allocates its own internal buffer. I... Guess this makes my job easier.... Should I just use that allocated buffer or should I override the constructor to do my own thing? My buffering strategy involves a buffer list for reading and writing, with each buffer being the page size of the system in question. When the buffer is filled, it flushes it all to disk. So essentially I'd be taking over the normal role of the FS cache (in a way) and bypassing it altogether.Beta Was this translation helpful? Give feedback.
All reactions