• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

question regarding java thread

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have one doubt of a question as follows...

Q Does the calling of setPriority() method cause a thread to stop executing??
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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�
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's generally recommended not to change thread priorities, as it is platform-dependent how threads with different priorities are handled.
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic