*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes question regarding java thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "question regarding java thread" Watch "question regarding java thread" New topic
Author

question regarding java thread

Chandan Ghosh
Greenhorn

Joined: Jun 13, 2005
Posts: 21
I have one doubt of a question as follows...

Q Does the calling of setPriority() method cause a thread to stop executing??


Thanks & Regards,<br />Chandan Ghosh<br />SCJP1.4
Andre Dings
Greenhorn

Joined: Aug 08, 2007
Posts: 1
Hi,

as you can see at Java 5 API Doc the method only sets a new priority in the thread group. That won't invoke a thread termination! I've never tested if it works, but as I understand this the thread will run with lower prio, so that other threads get more CPU time.

greets
Andr�


... excuse my horrendous english ...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41096
    
  44
It's generally recommended not to change thread priorities, as it is platform-dependent how threads with different priorities are handled.


Ping & DNS - my free Android networking tools app
camilo lopes
Ranch Hand

Joined: Aug 08, 2007
Posts: 202
Not, it only configures the priopridade of one thread. The value passing must be enters 1 to the 10. However some JVM not to implement of 1 to the 10 and yes of 1 to the 5. But if voc� to pass 10 jvm goes to adopt 5 as the maximum priority, you nao can pass a value is of this interval, therefore in execution time an exception occurs.


Brazil - Sun Certified Java Programmer - SCJP 5
http://www.camilolopes.com/ About Java - Update every Week.
Guide SCJP - tips that you need know http://blog.camilolopes.com.br/livrosrevistaspalestras/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question regarding java thread
 
Similar Threads
Alternative to xStream
how to import netbeans project into eclipse
Eval in Java?
Dynamic Method Invocation
error: not a valid directory