I'm looking for a way of letting many threads have read-access to different snapshots of a large file (10 GB) while another thread is writing changes randomly to the same file, without any of the changed bytes being visible to the readers and without making copies of the data.
I'm running this in a .NET 6 process with Docker on Linux (Synology DSM 7.1 to be specific) which is using Btrfs. Both Btrfs and Docker volumes seem to be using "copy-on-write" and use "snapshots" in various ways. I'm no expert but I think copy-on-write is the term to describe what I'm looking for here.
But the problem now is how to leverage this feature from within my .NET 6 process? My dream scenario would be something like this:
var read = File.Open("/file.txt", FileMode.Snapshot);
which of course doesn't work. Do you have any suggestions how I could move towards this using Btrfs, Docker volumes or something else for this usecase?