Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.programming
We have to reason like an expert...
Ramine
5/9/2016 11:05:00 PM
Hello,
We have to reason like an expert...
Since C++ can use registers to store variable, so
without memory barrier you can not be sure that
the variables on the registers will be flushed to
memory and made visible immediatly by the
cache-coherence protocol, so in C++ this is
a difficult situation, but since i am using
Delphi compiler and FreePascal compilers, i am safe,
because i am using dynamically allocated pointers,
and dynamically allocated pointers in FreePascal
and Delphi allow us to prevent the Delphi and FreePascal
compilers from using a register for the values of
dynamically allocated memory, but it still can use registers
for the addresses of the pointers, but this allow us to be safe
in Delphi an FreePascal compiler.
Other than that since i am not using memory barriers
or fences on the reader side, so in my algorithm
i have on the RLock() method this:
FCount1^[myid1].fcount1:=FCount1^[myid1].fcount1+1;
And on the RUnlock() method i have this:
FCount1^[myid1].fcount1:=0;
So in x86 since stores can not be reorder with otherther
loads and stores to the same location.
So i can state that finally my implementation of
my algorithm is safe and it does not need
the windows function FlushProcessWriteBuffers().
So you can download my new amd extended C++ synchronization objects
library from, i think that it is safe now:
https://sites.google.com/site/aminer68/c-synchronization-objec...
Thank you,
Amine Moulay Ramdane.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
We have to reason like an expert...
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password