Programming Problems

This computer tale was sent to us by Andy Skinner who says, “This came to me during a computer architecture course at UNC.”

As fast as computers go these days, one of the strategies of a computer processor is to allow multiple operations to go on at the same time. You have to ensure that things happen in the correct order, however.

If a program instructs the computer to read from a certain memory location and then write to it, the computer must be built to ensure that the read will actually occur first, so that you don’t read the value that was supposed to be written later.

There is a similar problem that can occur if you are supposed write to a memory location and then read it, but the read happens first, returning the value of the location before it was changed.

Finally, there is an error where the program was to write two different values to a memory location, but the operations happen out of order, and the memory location is left with the wrong value at the end. I think this was called a write-after-write condition, and is an example of when two writes can make a wrong.

Previous Post
Next Post

Leave a Reply

Your email address will not be published. Required fields are marked *