Details
-
Bug
-
Status: Resolved
-
High
-
Resolution: Done
-
None
-
None
Description
Genius and Netvirt are using a very funky locking scheme, which is precisely:
String foo; // related to what is being processed synchronized (foo.intern()) { // ... }
From software design perspective, this is bonkers, as this synchronizes with any entity performing this same thing (or accidentally uses synchronized(String)) – leading to potential collisions and preventing reasoning about locks.
From performance perspective, this is purely abysmal, as String.intern() is forcing a round-trip to the JVM level, cannot be optimized and is slow – as detailed in https://shipilev.net/jvm-anatomy-park/10-string-intern/ .
This needs to tackle only hiding this monstrosity behind an API, not with a complete migration of netvirt code to some other locking scheme.