Menu

Reading 0:00
15s threshold

In a single-core system, what happens if two threads from different processes access the same physical memory address?

The official answer says:

Neither program crashes, and both produce expected results.

I don't understand why that must be true.

A memory access could be a write, not just a read. For example, couldn't Thread A read/write that address, then get context-switched out, and Thread B access the same physical address before Thread A finishes its operation?

Wouldn't that potentially cause a race condition or unexpected result, even on a single core?

Am I missing an assumption in the question?

submitted by /u/ClerkDismal6922
[link] [comments]