Hi, Can anybody explain what is a memory barrier?
I was scanning through some of the sample code of module implementation. In many places author has called a macro 'mb()'. Without any detail comments author has said 'a memeory barrier is required...'. I found that mb is defined as 'do{;} while(0)'
----- Shirish@antara.net
--- Shirish wrote:
Hi, Can anybody explain what is a memory barrier?
I was scanning through some of the sample code of module implementation. In many places author has called a macro 'mb()'. Without any detail comments author has said 'a memeory barrier is required...'. I found that mb is defined as 'do{;} while(0)'
I am not sure but probably it has got something to do with the serializing of read and write functions on the device registers (in memory, i.e. memory mapped) in case of multi-threading/multi-processing (or even probably normal forked applications).
Nilesh.
________________________________________________________________________ For live cricket scores download Yahoo! Score Tracker at: http://in.sports.yahoo.com/cricket/tracker.html