RFR: 8315585: Optimization for decimal to string [v4]
Archie Cobbs
archie.cobbs at gmail.com
Fri Feb 7 15:42:48 UTC 2025
On Tue, Feb 4, 2025 at 5:26 PM Shaojin Wen <swen at openjdk.org> wrote:
> I think you are talking about the problem of PR #23420, which is caused by
> the use of thread-unsafe StringBuilder in multi-threaded scenarios. This
> problem is very obscure and I didn't consider it before. I have started to
> solve this problem and have submitted PR #23427. After it is completed, I
> will continue to submit PR to redo PR #19626 in a thread-safe way.
>
Yes - apologies if it sounded like I was trying to single you out. The
optimizations you've been doing are looking great. It's just that this
example is a good data point in the larger discussion about what the
general policy should be, etc.
> The above problem does not affect toString, because it only occurs when
> StringBuilder is used in a multi-threaded scenario.
>
Good point, but frankly, an irrelevant one. The key issue here is that if
plain, ordinary, non-native-invoking Java bytecode can corrupt memory
and/or crash the JVM, then that's a Big Problem™️. It doesn't matter how
contrived the code that makes it happen is.
-Archie
--
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20250207/67028683/attachment.htm>
More information about the core-libs-dev
mailing list