Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallelize hashing and transmitting blocks #3

Open
PhrozenByte opened this issue May 6, 2022 · 0 comments
Open

Parallelize hashing and transmitting blocks #3

PhrozenByte opened this issue May 6, 2022 · 0 comments

Comments

@PhrozenByte
Copy link
Owner

As soon as the local instance has both hashes of the first block, it might request this block from the sender and forward it to the receiver. However, it should be possible to disable parallelization, because reading hashes and reading/writing blocks at the same time will cause a heavy slowdown on HDD storages (unless network speed is slower anyway...).

Remotes then also need threading for computing hashes (async, i.e. we compute the next hash even though we didn't send the previous hash yet) and sending/receiving blocks (sync, i.e. we only send/receive one block at a time). We must furthermore add package identifiers to the network protocol (to distinguish hashes and blocks) and ensure that we don't accidentally mix packages mid-data (this can indeed happen because we use stdout/stdin; maybe with a third thread responsible for communications?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant