I am writing a hex editor program and I was thinking about when a user tries to open a very large file (3GB+). I wouldn't want the user to sit around all day for the whole file to load when it already has some data loaded.
So here is my question, would it be possible to have multiple threads read the file (not write) simultaneously, at different places, and then then once a certain threshold of data has been read by 1, that thread displays its data while the others continue to read? Would that offer me a performance improvement? Or would memory bandwidths reduce any speed gain I could get from using multiple threads?
For a hex-editor, there is no nead to read the whole file into memory. The user can only view or modify the data but without inserting or deleting.
You can simply use memory mapped files. The data will be automatically read when accessed and only the chunk displayed will be read. This provide fast scrolling and jumping to any location in the file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With