Question

Question 4 6 pts Which functions below are not thread safe? (assume no compiler issues) void deposit(struct account* act, int amt) act->balance+amt void withdraw(struct account act, int amt) act->balanceamt void printBalance(struct account act) printf(Balance of account %s-%d, act-name, act-balance); printBalance deposit D withdraw Question 5 6 pts For a race condition to occur, which of the below conditions must be met? No concurrency controls Accessing a shared resource O Multiple threads executing Blocking must exist around critical sections Mutual exclusion must be enforced O The code must be atomic

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Question 4:

deposit

withdraw

Question 5:

No concurrency controls

Accessing a shared resource

Multiple threads executing

The code must be atomic

Add a comment
Know the answer?
Add Answer to:
Question 4 6 pts Which functions below are not thread safe? (assume no compiler issues) void...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT