multithreading - Do java threads get deleted when they finish -



multithreading - Do java threads get deleted when they finish -

say spawn thread every couple seconds using method below , every thread takes sec complete. finished threads deleted?

new thread (new myrunnableclass()).start();

the native, os-level thread released thread finishes (circa when run() finishes), thread object lives, other object, until becomes unreachable , garbage collector feels running.

edit: might interesting know thread (in sun's oracle's implementation, anywho) has private method called vm when thread exits, aggressively nulls several fields, including 1 referring runnable set thread(runnable) constructor. if retain reference thread, things doesn't need after finishing execution released, regardless.

java multithreading concurrency

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -