jtulach commented on PR #9635:
URL: https://github.com/apache/netbeans/pull/9635#issuecomment-5808869270
> * For the threading question: no for the same `StringReference` only a
single `StringInfo` will be created. If `getStringWithLengthControl` is called
twice in parallel for the same `StringReference` the guard at the start of
`getStringWithLengthControl` will be hit
- I see. The Synchronization pattern is (almost) right, but done with old
good Java synchronization primitives
- the case of `catch (InterruptedException ex) {}` seems to be handle
improperly
- these days one would code this with `Future`s
- the first request adds a pending `Future` to the concurrent map
- and starts computing it then
- the other requests just obtain the `Future` and call `get()`
- Enso did it for [example
here](https://github.com/enso-org/enso/pull/13807/changes#r2715421221)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists