13. 14 pts) Consider a system that has two CPUs and each CPU has two threads (hyperthreading), Suppose six programs, PA,
Posted: Fri May 20, 2022 11:37 am
13. 14 pts) Consider a system that has two CPUs and each CPU has two threads (hyperthreading), Suppose six programs, PA, PB, PC, PD, PE, and PF, are started with run times of 5, 8, 2, 3. 15, and 20msec, respectively. How long will it take to complete the execution of all these programs? Assume that all six programs are 100% CPU bound, do not block during execution, and do not change CPU's once assigned 14. [4 pts) Suppose two threads execute the following code concurrently, accessing shared variables a, b, and e: Initialization Thread 1 Thread 2 int a 4; int b=0; int e=0; if (a <0) {c-b-a:) else {c=b+a:) b = 10; a = -3; What are two possible values for e after both threads complete? You can assume that reads and writes of the variables are atomic, and that the order of statements within each thread is preserved in the code generated by the compiler. Why is this happening and how could you fix it?