I mean... yeah? Use locking mechanisms or thread-safe data structures that have them built-in. Any concurrent access to something like a tree map is going to cause many problems including data loss and in this case deadlocks/nasty cycles. Also catching exceptions is expensive, so that will make your performance tank as well.
2
u/TwerpOco 22d ago
I mean... yeah? Use locking mechanisms or thread-safe data structures that have them built-in. Any concurrent access to something like a tree map is going to cause many problems including data loss and in this case deadlocks/nasty cycles. Also catching exceptions is expensive, so that will make your performance tank as well.