Home » U++ Library support » U++ MT-multithreading and servers » MT and variables simple question
Re: MT and variables simple question [message #43254 is a reply to message #43241] |
Mon, 16 June 2014 17:45  |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
ManfredHerr wrote on Thu, 12 June 2014 21:44OK!
This is another example of the experience that in IT you cannot trust to what you learned some years ago. I always considered a machine instruction, i.e. an OP-Code to be executed completely, or not at all. Even if some micro software is involved. The possibility of interrupting within an instruction is new to me. However, I wonder what value is kept in the Program Counter for return from interrupt then.
I am sorry to have caused fuss. In the future, I will keep my two cents with me.
It is not that much (in fact, not at all) about interrupting, it is more about the fact that CPU execution core is not executing opcodes as they are. Instead, everything is broken into smaller operations and executed out-of-order. So it is entirely possible that the "store" part of x++ is executed many cycles after the "load" part and a flow of other instructions or theirs parts is executed within that time.
Within single thread, these out-of-order issues are invisible to programmer, because in single thread CPU guarantees memory consistency, but with more CPU cores, the real hell begins 
BTW, not much mentioned effect of every mutex implementation is that it takes care about read/write ordering too, doing memory barriers as necessarry...
|
|
|
 |
|
MT and variables simple question
By: koldo on Thu, 05 June 2014 10:29
|
 |
|
Re: MT and variables simple question
By: Didier on Thu, 05 June 2014 22:32
|
 |
|
Re: MT and variables simple question
By: koldo on Fri, 06 June 2014 14:23
|
 |
|
Re: MT and variables simple question
By: Didier on Fri, 06 June 2014 15:48
|
 |
|
Re: MT and variables simple question
By: koldo on Sun, 08 June 2014 17:01
|
 |
|
Re: MT and variables simple question
By: Didier on Mon, 09 June 2014 20:36
|
 |
|
Re: MT and variables simple question
By: koldo on Tue, 10 June 2014 08:46
|
 |
|
Re: MT and variables simple question
|
 |
|
Re: MT and variables simple question
By: mirek on Wed, 11 June 2014 08:16
|
 |
|
Re: MT and variables simple question
By: Didier on Thu, 12 June 2014 21:06
|
 |
|
Re: MT and variables simple question
|
 |
|
Re: MT and variables simple question
By: mirek on Mon, 16 June 2014 17:45
|
Goto Forum:
Current Time: Tue Apr 29 08:14:29 CEST 2025
Total time taken to generate the page: 0.03486 seconds
|