Question: Consider the following code runs in a multi - threaded environment: uint 3 2 _ t threadRunning; void thread 1 ( ) { while (

Consider the following code runs in a multi-threaded environment:
uint32_t threadRunning;
void thread1()
{
while(true)
{
threadRunning =1;
}
}
void thread2()
{
while(true)
{
threadRunning =2;
}
}
Assume a system has only two threads running: one is running the thread1() function and the other the thread2() function. With no other information about the operating system or scheduler type, what can you say about CPU utilization of each thread?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!