[concurrency-interest] NullPointerExceptionin ThreadLocal$ThreadLocalMap.replaceStaleEntry
tackline at tackline.plus.com
Fri Jun 30 15:42:20 EDT 2006
Taras Tielkes wrote:
> A good example is a servlet that generates images (thus
> lazy-initializing the Java2D headless subsystem, to be specific, the
> sun.java2d.Disposer thread).
> The first webapp to do this will leak a reference to any
> currently-for-that-thread ITL to the Disposer thread (which only shuts
> down when the JVM shuts down.
Yup, you can end up with system threads having, say, an Applet's
TimeZone. Most such thread creation code fix the ThreadGroup but not
Rather than making Thread even more baroque, perhaps a better way around
the problem would be to have a system thread responsible for creating
other system threads. Likewise containers should not spawn their own
threads from a thread accessible to user code.
More information about the Concurrency-interest