• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Threads

 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If a Thread's priority is not specified explicitly then it gets a priority of Thread.NORM_PRIORITY.
Answer is given as false. What should be the default priority if its not specified for a single thread.
-Arun
 
Arun Pai
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Khalid mughal mentions default priority of 5 Thread.NORM_PRIORITY. Then why JQ+ has given the answer as false. It should be true, Right???

-Arun
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The newly created thread initially gets the priority of the thread that created it.
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From glancing at the documentation, this is what I see concerning Thread.NORM_PRIORITY:


The default priority that is assigned to a thread.


Looks like this is the value that is assigned to a thread object by default. However, if the thread that created it had a different priority, the new one will have the same priority.
Corey
[ April 09, 2002: Message edited by: Corey McGlone ]
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Arun,
Yeah thread gets a default priority of 5(Thread.Norm_PRIORITY) if not specified..but this is not true always as the thread gets its default priority from the thread which created it(child thread inherits the priority from parent thread)..so the question seems to mean that the thread is always getting the default priority of 5,which may not always be true.
Hope this helps
Swapna
 
Arun Pai
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank U Swapna, Valentine , Corey.
-Arun
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic