1 posts in topic
Flat View  Flat View

Posted By:   rajesh_kumar
Posted On:   Wednesday, September 12, 2001 07:58 AM

i want to know whether the run method is called immediately at the time
when t.start() method is called or it
may be called independently by the operating system.

Re: question.

Posted By:   Christopher_Schultz  
Posted On:   Thursday, September 13, 2001 12:44 PM

Your run method is not guarenteed to run immediately after the Thread.start() method is called.

The Java Language Specification gives implementations lots of legroom with respect to the scheduling of threads. Your thread may start immediately, or it may start 5 minutes later.

Any decent implementation will have your thread start as soon as possible under the scheduling algorithm, so a five minute wait would be unreasonable.

About | Sitemap | Contact