[bisq-network/bisq] Make serialisation in FileManager::saveToFile thread-safe (#4025)

Steven Barclay notifications at github.com
Tue Mar 10 10:07:58 UTC 2020


I've just pushed changes to address some of the issues pointed out above. I renamed `toProtoMessageSynchronized` and added `UserThreadMappedPersistableEnvelope` as suggested. There was another commit I intended to push to serialise `SequenceNumberMap` on the user thread, by making it implement the new interface instead of `ThreadedPersistableEnvelope`. However, benchmarking the code in the same way as above showed that it adds considerable overhead:

[Serialisation_Benchmarks_with_SequenceNumberMap.txt](https://github.com/bisq-network/bisq/files/4311586/Serialisation_Benchmarks_with_SequenceNumberMap.txt)

I think it would be better to make it continue to implement `ThreadedPersistableEnvelope` and rely on the concurrency guarantees of `ConcurrentHashMap` if possible. (That should effectively synchronise reads and updates of the optional map value, at each potential key independently.)


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4025#issuecomment-597004089
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200310/d35f1d3a/attachment.html>


More information about the bisq-github mailing list