Question

What makes race conditions bad? Name and briefly describe two distinct factors needed for a race...

What makes race conditions bad? Name and briefly describe two distinct factors needed for a race condition to exist. (PLEASE HELP)

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

Race conditions occurs when two or more threads or processes try to access and change same shared data or execute same piece of code simultaneously which often leads to inconsistent results.

Race conditions are bad as it leads to wrong and inconsistent results. Output of the program depends upon the order in which the thread access the shared data. So incorrect sequence of accessing shared data leads to wrong outputs.

For race conditions to exist following factors are needed :

1. There are  two or more threads or processes which are trying to execute same piece of code or shared data simultaneously

2. There is shared data called critical section which both threads or process are trying to access at same time and changing it which leads to  inconsistent results.

Add a comment
Know the answer?
Add Answer to:
What makes race conditions bad? Name and briefly describe two distinct factors needed for a race...
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