Domanda

I have an understanding on how a race condition works how would I Show a series of time steps that demonstrate a race condition on a dual core processor.

È stato utile?

Soluzione

In what language, program, platform, to whom ? If you understand why and in what situations a race condition would happen, you could simply create a fictional/hypothetical situation and make up some realistic timestamps and write them down.

Edit:
Number of cores doesn't matter.
1: Thread/process A loads the variable VAL1
2: Thread/process A does some calculations with VAL1
3: Thread/process B loads the variable VAL1
4: Thread/process A stores the result from its calculations into VAL1, ei overriding its previous value
5: Thread/process B does some very different calculations with VAL1
6: Thread/process B stores its result in VAL1

VAL1 will now contain the result that thread/process B calculated and all the work that thread/process A did, will be overridden and forgotten forever.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top