You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to avoid performance degradation when using virtual threads (see #2185), usage of thread locals for caching resources should be minimized or completely avoided.
Acording to the comment #2185 (comment), there are a few ThreadLocal variables used as cache:
Thread cache:
modules/grizzly/src/main/java/org/glassfish/grizzly/ThreadCache.java:36: private static final ThreadLocal<ObjectCache> genericCacheAttr = new ThreadLocal<>();
Some variables potentially used for caching - if not used for caching, may remain as is:
modules/comet/src/main/java/org/glassfish/grizzly/comet/CometContext.java:101: protected final static ThreadLocal<Request> REQUEST_LOCAL = new ThreadLocal<>();
modules/http-servlet/src/main/java/org/glassfish/grizzly/servlet/WebappContext.java:144: private final ThreadLocal<DispatchData> dispatchData = new ThreadLocal<>();
Thread-unsafe formatters cached for performance purposes - these should be replaced by global DateTimeFormatter instances, which is thread-safe and can be reused by multiple threads:
modules/http/src/main/java/org/glassfish/grizzly/http/util/CookieUtils.java:73: public static final ThreadLocal<SimpleDateFormat> OLD_COOKIE_FORMAT = new ThreadLocal<SimpleDateFormat>() {
modules/http/src/main/java/org/glassfish/grizzly/http/util/FastHttpDateFormat.java:55: private static final ThreadLocal<SimpleDateFormatter> FORMAT = new ThreadLocal<SimpleDateFormatter>() {
The text was updated successfully, but these errors were encountered:
In order to avoid performance degradation when using virtual threads (see #2185), usage of thread locals for caching resources should be minimized or completely avoided.
Acording to the comment #2185 (comment), there are a few ThreadLocal variables used as cache:
Thread cache:
modules/grizzly/src/main/java/org/glassfish/grizzly/ThreadCache.java:36: private static final ThreadLocal<ObjectCache> genericCacheAttr = new ThreadLocal<>();
Some variables potentially used for caching - if not used for caching, may remain as is:
modules/comet/src/main/java/org/glassfish/grizzly/comet/CometContext.java:101: protected final static ThreadLocal<Request> REQUEST_LOCAL = new ThreadLocal<>();
modules/http-servlet/src/main/java/org/glassfish/grizzly/servlet/WebappContext.java:144: private final ThreadLocal<DispatchData> dispatchData = new ThreadLocal<>();
Thread-unsafe formatters cached for performance purposes - these should be replaced by global
DateTimeFormatter
instances, which is thread-safe and can be reused by multiple threads:modules/http/src/main/java/org/glassfish/grizzly/http/util/CookieUtils.java:73: public static final ThreadLocal<SimpleDateFormat> OLD_COOKIE_FORMAT = new ThreadLocal<SimpleDateFormat>() {
modules/http/src/main/java/org/glassfish/grizzly/http/util/FastHttpDateFormat.java:55: private static final ThreadLocal<SimpleDateFormatter> FORMAT = new ThreadLocal<SimpleDateFormatter>() {
The text was updated successfully, but these errors were encountered: