subject

Suppose two threads execute the following C code concurrently, accessing shared variables a, b, and c: Initialization int a = 4; int b = 0; int c = 0; Thread 1 Thread 2 if (a < 0) { b = 10; c = b-a; a = -3; } else { c = b + a; } What is the total number of possible values for c 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 C compiler?

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:30
Your boss wants you to configure his laptop so that he can access the company network when he is on the road. you suggest a vpn connection to him. he is very concerned about security and asks you how secure vpn is. what do you tell him?
Answers: 1
question
Computers and Technology, 22.06.2019 17:00
Annie is creating a corporate report for a company’s annual meeting. in the report, she wants to add the signature of various department heads. which device can annie use to capture signatures to include in the report? a. printer b. monitor c. e-reader d. digitizing tablet
Answers: 1
question
Computers and Technology, 22.06.2019 17:30
Ou listened to a song on your computer. did you use hardware or software?
Answers: 2
question
Computers and Technology, 23.06.2019 01:50
Create a class named majors that includes an enumeration for the six majors offered by a college as follows: acc, chem, cis, eng, his, phys. display the enumeration values for the user, then prompt the user to enter a major. display the college division in which the major falls. acc and cis are in the business division, chem and phys are in the science division, and eng and his are in the humanities division. save the file as majors.java.
Answers: 2
You know the right answer?
Suppose two threads execute the following C code concurrently, accessing shared variables a, b, and...
Questions
question
Mathematics, 25.01.2022 03:00
question
Mathematics, 25.01.2022 03:10
question
Mathematics, 25.01.2022 03:10
question
Mathematics, 25.01.2022 03:10
question
Mathematics, 25.01.2022 03:10