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
With the introduction of Fixed buffers I was curious if it would be possible to also expose thread safe handles to those buffers? I.e supporting operations on different threads (and runtimes) but still utilizing the same buffer pool. The use case I have in mind for example is having a separate disk-io thread which would be distinct from the thread reading data from a socket. It would be neat if both could share the same buffer pool by propagating the handles from the socket thread to the disk thread and then use write_fixed there.
After discussions on discord it seems like at a minimum register_buffers and unregister_buffers needs to be exposed publicly for it to be possible for end users to create their own buffer registries.
The text was updated successfully, but these errors were encountered:
I realize now that another problem is that all the io objects like TcpStream etc only accepts the FixedBuf handle making it impossible to use a custom registry that would with thread safe handles.
The reference counting mechanics would need to be redone with something like Arc<Mutex<FixedBuffers>>, which would cause unnecessary overhead in the single threaded case.
I think it should be possible to have thread-safe fixed buffer collections alongside the current ones. For operations, it should be possible to generalize with a marker trait.
With the introduction of Fixed buffers I was curious if it would be possible to also expose thread safe handles to those buffers? I.e supporting operations on different threads (and runtimes) but still utilizing the same buffer pool. The use case I have in mind for example is having a separate disk-io thread which would be distinct from the thread reading data from a socket. It would be neat if both could share the same buffer pool by propagating the handles from the socket thread to the disk thread and then use write_fixed there.
After discussions on discord it seems like at a minimum
register_buffers
andunregister_buffers
needs to be exposed publicly for it to be possible for end users to create their own buffer registries.The text was updated successfully, but these errors were encountered: