Re:JVM Anatomy Quark #10: String.intern (2019)
by Andaith on Thursday June 23, 2022 @12:10AM
(#31845072)
It allows you to do this:
synchronised(bob.intern()) {
//This block executes in parallel for requests with different values of bob, but sequentially for each request that has the same value of bob.
}
If I didn't have to integrate with a weird 3rd party API where this was necessary, I wouldn't know about String.intern()...
synchronised(bob.intern()) { //This block executes in parallel for requests with different values of bob, but sequentially for each request that has the same value of bob. }
If I didn't have to integrate with a weird 3rd party API where this was necessary, I wouldn't know about String.intern()...