1) There are 10 different threads in runnable state. Each
having priority 1 to 10. How does the CPU schedules or
executes these threads?

Answers were Sorted based on User's Feedback



1) There are 10 different threads in runnable state. Each having priority 1 to 10. How does the CP..

Answer / karthik

We are not sure about when a thread runs it depends upon the
thread scheduler which can able to run a thread at any time
so the priorities are not sure even if we use the
setpriority method for a thread : ref scjp book thread chapter

Is This Answer Correct ?    10 Yes 3 No

1) There are 10 different threads in runnable state. Each having priority 1 to 10. How does the CP..

Answer / shiv

At any given time the highest priority thread will always
be in a execution state. if there are more than one threads
with same priority then JVM decides which one should be
executed first. Thus if the priority is from 1..10 the they
will be scheduled for execution in a reverse manner.

Is This Answer Correct ?    10 Yes 4 No

Post New Answer

More Core Java Interview Questions

Real Time sample code for Encapsulation and Abstraction. where to use abstract and where to use specifies like public private.

2 Answers  


What is unicode?

5 Answers  


1) There are 10 different threads in runnable state. Each having priority 1 to 10. How does the CPU schedules or executes these threads?

2 Answers   RBS,


How do I print a “?

1 Answers  


Is it possible to write static method in abstract class? justyfy your answer?

5 Answers   Hexaware,


Can we compare two strings in java?

1 Answers  


How does the garbage collector works in java?

1 Answers   Cyient,


What is a void in java?

1 Answers  


How to use Media tracker Class.

1 Answers  


Tell me the programme for this @ 1 2 @ @ @ 1 2 3 4

5 Answers   Accenture, iGate, IntoNET, Value Labs,


What is better- service oriented or batch oriented solutions?

1 Answers   Amdocs,


What is the life cycle of Servlet?

3 Answers  


Categories