From: thefed Date: 2008-01-01T06:53:29+09:00 Subject: Re: Why not call Thread.join? On Dec 31, 2007, at 3:46 PM, Craig Beck wrote: > try looking at the crude timeline below... > > sec 0 1 2 3 4 5 > 6 7 > |---------|---------|---------|---------|---------|---------|-------- > -| > main ====@================================================= > t[1] =================================================== > t[2] =================================================== > t[3] =================================================== > > The @ on the main thread represents when the t.join gets called. It > waits in this simple case for t[1] to finish it's work (sleeping > for 5 seconds), then waits for t[2]. As t[2] has also been doing > work all this time, it only blocks the main thread for another 0.1 > sec before finishing. Same for t[3]. So this contrived example it > takes 5 seconds + whatever overhead for starting threads. > > You could throw more instrumentation in there if you wish and do > things like adding additional calls to sleep to simulate extra > thread overhead to make it more obvious. Thank you SO MUCH! This really clears threading up for me. In retrospect it was less than obvious, but evident nonetheless. But this timeline really made the difference for me. Thank you! - Ari