in Education by
What will happen if two thread of the same priority are called to be processed simultaneously? (a) Anyone will be executed first lexographically (b) Both of them will be executed simultaneously (c) None of them will be executed (d) It is dependent on the operating system I have been asked this question in exam. This interesting question is from Multithreading Basics in section Multithreading of Java Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
The correct answer is (d) It is dependent on the operating system The explanation: In cases where two or more thread with same priority are competing for CPU cycles, different operating system handle this situation differently. Some execute them in time sliced manner some depending on the thread they call.

Related questions

0 votes
    Which of these method is used to explicitly set the priority of a thread? (a) set() (b) make() ( ... in division Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method of Thread class is used to find out the priority given to a thread? (a) get( ... division Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Thread priority in Java is? (a) Integer (b) Float (c) double (d) long The question was asked in ... in chapter Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    What decides thread priority? (a) Process (b) Process scheduler (c) Thread (d) Thread scheduler The ... Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method is used to tell the calling thread to give up a monitor and go to sleep until ... division Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of the following will ensure the thread will be in running state? (a) yield() (b) notify() (c ... section Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method wakes up the first thread that called wait()? (a) wake() (b) notify() (c) ... in section Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    What is the default value of priority variable MIN_PRIORITY AND MAX_PRIORITY? (a) 0 & 256 (b) 0 & 1 ... section Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of this method can be used to make the main thread to be executed last among all the threads? ... portion Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of this method is used to find out that a thread is still running or not? (a) run() (b) ... in chapter Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method waits for the thread to terminate? (a) sleep() (b) isAlive() (c) join() (d ... in division Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    What is synchronization in reference to a thread? (a) It's a process of handling situations when two or ... Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method is used to begin the execution of a thread? (a) run() (b) start() (c) ... in chapter Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method of Thread class is used to Suspend a thread for a period of time? (a) sleep() ... portion Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
...