handler's handle
handler's handle

Reputation: 395

Competition among processes for resources

My OS textbook says the following in a chapter discussing concurrency:

Concurrent processes come into conflict with each other when they are competing for the use of the same resource. In its pure form, we can describe the situation as follows. Two or more processes need to access a resource during the course of their execution. Each process is unaware of the existence of other processes, and each is to be unaffected by the execution of the other processes. It follows from this that each process should leave the state of any resource that it uses unaffected.

My question specifically concerns the last sentence:

It follows from this that each process should leave the state of any resource that it uses unaffected.

This does not make sense to me. If a process is using a resource, then it must necessarily affect the state of that resource. This seems obvious, but it sounds like the sentence is disagrees?

I would greatly appreciate it if the members of this site could please take the time to clarify this.

Upvotes: 0

Views: 954

Answers (1)

Tony Tannous
Tony Tannous

Reputation: 14866

While it is not clear to me in what context this was said, as you mentioned a small portion of the quote. And didn't even bother to mention the book you quoted. However, I can shoot in the dark and assume that what they meant is: A process using resource X should, once done using it, leave it unaffected. That is, if processY decides to use logical resource, i.e. a file, it should not write or change the file as this might affect processZ which needs to use the file with its original data.

When it comes to physical resources, the statement above makes no sense... unless you provide the full quote.

Upvotes: 1

Related Questions