Question

In: Computer Science

3. Be creative, but realistic: Describe an example (of your own creation) of a system that...

3. Be creative, but realistic: Describe an example (of your own creation) of a system that would be susceptible to a race condition, and what might happen to cause the race condition in your imagined system. Then explain what might be the effect of that race condition in your particular system. The goal in this last part is to imagine a real-world system and to describe it in a way that the marker can understand as well as showing how it could be affected by a race condition.

Solutions

Expert Solution

Answer:-

A race condition is an undesirable situation that occurs when a device or system attempts to perform two or more operations at the same time, but because of the nature of the device or system, the operations must be done in the proper sequence to be done correctly.

A simple example of a race condition is a light switch. In some homes there are multiple light switches connected to a common ceiling light. When these types of circuits are used, the switch position becomes irrelevant. If the light is on, moving either switch from its current position turns the light off. Similarly, if the light is off, then moving either switch from its current position turns the light on. With that in mind, imagine what might happen if two people tried to turn on the light using two different switches at exactly the same time. One instruction might cancel the other or the two actions might trip the circuit breaker.

Race conditions are most commonly associated with computer science. In computer memory or storage, a race condition may occur if commands to read and write a large amount of data are received at almost the same instant, and the machine attempts to overwrite some or all of the old data while that old data is still being read. The result may be one or more of the following: a computer crash, an "illegal operation," notification and shutdown of the program, errors reading the old data or errors writing the new data. A race condition can also occur if instructions are processed in the incorrect order.

Suppose for a moment that two processes need to perform a bit flip at a specific memory location. Under normal circumstances the operation should work like this:

Process 1 Process 2 Memory Value
Read value 0
Flip value 1
Read value 1
Flip value 0

In this example, Process 1 performs a bit flip, changing the memory value from 0 to 1. Process 2 then performs a bit flip and changes the memory value from 1 to 0.

If a race condition occurred causing these two processes to overlap, the sequence could potentially look more like this:

Process 1 Process 2 Memory Value
Read value 0
Read value 0
Flip value 1
Flip value 1

In this example, the bit has an ending value of 1 when its value should be 0. This occurs because Process 2 is unaware that Process 1 is performing a simultaneous bit flip.

Security vulnerabilities caused by race conditions

When a program that is designed to handle tasks in a specific sequence is asked to perform two or more operations simultaneously, an attacker can take advantage of the time gap between when the service is initiated and when a security control takes effect in order to create a deadlock or thread block situation. With deadlock, two or more threads must wait for a lock in a circular chain. This defect can cause the entire software system to halt because such locks can never be acquired if the chain is circular. Thread block can also dramatically impact application performance. In this type of concurrency defect, one thread calls a long-running operation while holding a lock and preventing the progress of other threads.

Preventing race conditions

In computing environments, race conditions can be prevented by serialization of memory or storage access. This means if read and write commands are received close together, the read command is executed and completed first by default.

In a network, a race condition may occur if two users attempt to access an available channel at the same instant, and neither computer receives notification the channel is occupied before the system grants access. Statistically, this kind of coincidence will most likely occur in networks with long lag times, such as those that use geostationary satellites. To prevent such a race condition from developing, a priority scheme must be devised. For example, the subscriber whose username begins with the earlier letter of the alphabet (or the lower numeral) may get priority by default when two subscribers attempt to access the system within a prescribed increment of time. Hackers can take advantage of race-condition vulnerabilities to gain unauthorized access to networks.

Race conditions occasionally occur in logic gates when certain inputs come into conflict. Because the gate output state takes a finite, nonzero amount of time to react to any change in input states, sensitive circuits or devices following the gate may be fooled by the state of the output, and thereby not operate properly.


Related Solutions

3. Be creative, but realistic: Describe an example (of your own creation) of a system that...
3. Be creative, but realistic: Describe an example (of your own creation) of a system that would be susceptible to a race condition, and what might happen to cause the race condition in your imagined system. Then explain what might be the effect of that race condition in your particular system. The goal in this last part is to imagine a real-world system and to describe it in a way that the marker can understand as well as showing how...
Draw by hand a 3 pass transmembrane protein of your own creation (not a known one)...
Draw by hand a 3 pass transmembrane protein of your own creation (not a known one) through a plasma membrane. In your drawing clearly draw and label: The plasma membrane and the extracellular and cytosolic side The C and N terminus All the regions where you expect to find higher proportions of polar amino acids All the regions where you expect to find higher proportions of nonpolar amino acids.
a) Describe, using a schematic/diagram of your own creation, how an electron microscope changes from low...
a) Describe, using a schematic/diagram of your own creation, how an electron microscope changes from low magnification to high magnification. b) Why is it preferable to image a conductive surface in an SEM? c) Is the conductivity of the sample as critical in a TEM as it is in an SEM? Why or why not?
Explain creative curriculum in one paragraphy using your own words ?
Explain creative curriculum in one paragraphy using your own words ?
Use a firm of your choice, either real or of your own creation aand write as...
Use a firm of your choice, either real or of your own creation aand write as from the perspective who has just been hired to conduct and audit of the firm. a) Using the firm you have chosen, outline a thorough outline for the audit that includes descriptions of particularly important issues to be dealt with along the way. b) Using the firm you are auditing, thoroughly outline the evidence you will gather. Explain the importance of each type and...
Use a firm of your choice, either real or of your own creation aand write as...
Use a firm of your choice, either real or of your own creation aand write as from the perspective who has just been hired to conduct and audit of the firm. explain each part at least in 200 words. a) Using the firm you have chosen, outline a thorough outline for the audit that includes descriptions of particularly important issues to be dealt with along the way. b) Using the firm you are auditing, thoroughly outline the evidence you will...
In your own words, do you think the media and movies perpetuate a realistic view of...
In your own words, do you think the media and movies perpetuate a realistic view of marriage or an unrealistic view? Do you think people truly know what marriage is all about before getting married or do you think they expect a fantasy?
12. a. (3) Define and give your own example of consumer surplus. b. (3) Define and...
12. a. (3) Define and give your own example of consumer surplus. b. (3) Define and give your own example of producer surplus. c.(3) Why do economist use consumer and producer surplus to measure the costs and benefits of trade and protectionism? 13. a. (3) What is Adam Smith’s invisible hand of the market? b. (3) What does this imply about international trade?
4. Describe the availability tendency in your own words, and give an example of how the...
4. Describe the availability tendency in your own words, and give an example of how the tendency could result in a lack of audit effectiveness. How can the tendency be mitigated? 5. Describe the confirmation tendency in your own words, and give an example of how the tendency could result in a lack of audit effectiveness. How can the tendency be mitigated? 6. Describe the overconfidence bias in your own words, and give an example of how the bias could...
a) In your own words or using an example, describe each condition and its relevance for...
a) In your own words or using an example, describe each condition and its relevance for the three conditions for profitable price discrimination (1. have market power, 2. be able to identify submarkets, and 3. be able to separate submarkets). b) Suppose a perfectly price-discriminating firm faces demand function: ? = 22 − ? And has cost function: ? = 25 + 4? + (1 /2) ?^2 Identify the quantity he sells, the price(s) he charges, and the profits he...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT