scottyuancoc commented on PR #10: URL: https://github.com/apache/sling-org-apache-sling-scripting-javascript/pull/10#issuecomment-3148864657
Hello @rombert, I’ve spent some additional time evaluating the options and have ultimately decided to use the double-checked locking pattern with AtomicReference, rather than the approach using a NULL_OBJECT as an intermediate state. The reason for this change is that the NULL_OBJECT approach isn't fully thread-safe in all scenarios. The revised implementation ensures proper thread safety while still offering reasonable performance. Thanks again for the valuable discussion and input. Let me know if this approach looks good to you. -- 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: dev-unsubscr...@sling.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org