Click here to Skip to main content
15,915,019 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Impact of synchronization on application performances Pin
Jijo.Raj19-Aug-08 6:40
Jijo.Raj19-Aug-08 6:40 
GeneralRe: Impact of synchronization on application performances Pin
Ahmed Charfeddine19-Aug-08 6:53
Ahmed Charfeddine19-Aug-08 6:53 
GeneralRe: Impact of synchronization on application performances Pin
Jijo.Raj19-Aug-08 7:19
Jijo.Raj19-Aug-08 7:19 
GeneralRe: Impact of synchronization on application performances Pin
Ahmed Charfeddine19-Aug-08 21:50
Ahmed Charfeddine19-Aug-08 21:50 
GeneralRe: Impact of synchronization on application performances Pin
Cedric Moonen19-Aug-08 7:22
Cedric Moonen19-Aug-08 7:22 
GeneralRe: Impact of synchronization on application performances Pin
Ahmed Charfeddine20-Aug-08 0:39
Ahmed Charfeddine20-Aug-08 0:39 
GeneralRe: Impact of synchronization on application performances Pin
Cedric Moonen20-Aug-08 1:08
Cedric Moonen20-Aug-08 1:08 
GeneralRe: Impact of synchronization on application performances Pin
Ahmed Charfeddine20-Aug-08 1:37
Ahmed Charfeddine20-Aug-08 1:37 
Ah OK, maintenant je comprend pkoi le crash avec CString. Je vais sérieusment considerer l'utilisation des tableau fixe TCHAR maintenant.

Ce que je ne comprend pas encore beaucoup c'est cette est affaire des flags..Leur implémentation les rendes atomique et synchronisé vous me dites ?

Ce n'est qu'aujourdhui que je reli une autre chose contre cela :
voila cet article qui m'a été suggéré par Roger :
http://www.flounder.com/no_synchronization.htm[^]
(rechercher la ligne avec l'occurance : a++).

Meme faire des write ou des read sur un bool c'est pas syncronisé par défaut.

OK laisson tomber le détail interne de ces op, si l'incérmentation d'un int ou la mise d'un bool à la valuer vrai est atomique ou non, et regarde mon scénario suivant se basant sur la possibilté de context switch sur les thread :

suppose k'un writer (thread A) accède à name :
iStartCount++;
puis rentre dans :
name=_T("Tunisia");
avant de faire au final :
iEndCount++;

le reader B fait un while sur le code suivant pour voir est ce que
iStartCount==iEndCount :


CString getName()
{
while(true)
{
int iStartCount_localCopy=iStartCount;
CString name_localCopy=name;
int iEndCount_localCopy=iEndCount;
if(iStartCount_localCopy==iEndCount_localCopy)
return name_localCopy;
}
}

B et A peuvent rentrer concuremment dans les deux blocs :
B prend la meme valueur iStartCount positionné par A,
ensuite A lmodifie name, et B prend la valeur corrompue en meme temps que lui,
finalement un context switch se déclenche sur B et donc A a le temps pour rendre iEndCount semblable à iStartCount, ensuite B revient fait la compariason et donc juge que sa copie n'est pas corrompue.
Déjà il y a un scénario très mauvais selon quoi la valeur de iEndCount retenue par B est > que iStartCount, et cela qd le context switch effectué sur B permet à A d'exécuter encore une autre fois le bloc sité, et dans ce cas ma boucle reste infinie.....
Bon biensur ma boucle, peut etre que j'ai maladroitement implémenté votre idée (bien ke meme is B fait une copie de iStartCount et iEndCount avant name, alors il un autre scénario bizarre ici ki peu avoir lieu..

Our Philosophy, Mohammed Baqir Al Sadr

GeneralRe: Impact of synchronization on application performances Pin
Cedric Moonen20-Aug-08 2:11
Cedric Moonen20-Aug-08 2:11 
GeneralRe: Impact of synchronization on application performances Pin
Cedric Moonen31-Aug-08 22:35
Cedric Moonen31-Aug-08 22:35 
QuestionHow to get the full path of a file (Win32 api) Pin
ice87111719-Aug-08 4:43
ice87111719-Aug-08 4:43 
AnswerRe: How to get the full path of a file (Win32 api) Pin
David Crow19-Aug-08 5:07
David Crow19-Aug-08 5:07 
QuestionRe: How to get the full path of a file (Win32 api) Pin
led mike19-Aug-08 5:27
led mike19-Aug-08 5:27 
AnswerRe: How to get the full path of a file (Win32 api) Pin
ice87111720-Aug-08 19:26
ice87111720-Aug-08 19:26 
AnswerRe: How to get the full path of a file (Win32 api) Pin
Member 419459319-Aug-08 7:40
Member 419459319-Aug-08 7:40 
QuestionCString Format Help Pin
locoone19-Aug-08 4:41
locoone19-Aug-08 4:41 
AnswerRe: CString Format Help Pin
David Crow19-Aug-08 5:15
David Crow19-Aug-08 5:15 
AnswerRe: CString Format Help Pin
sudhir_Kumar19-Aug-08 5:29
sudhir_Kumar19-Aug-08 5:29 
Questionboost exe problem vs8 Pin
andymonaco19-Aug-08 4:23
andymonaco19-Aug-08 4:23 
AnswerRe: boost exe problem vs8 Pin
santhoshv8419-Aug-08 20:57
santhoshv8419-Aug-08 20:57 
AnswerRe: boost exe problem vs8 Pin
andymonaco19-Aug-08 23:05
andymonaco19-Aug-08 23:05 
QuestionWhere should I post queries about Windows Drivers? Pin
Numero Uno19-Aug-08 3:09
Numero Uno19-Aug-08 3:09 
AnswerRe: Where should I post queries about Windows Drivers? [modified] Pin
Rajesh R Subramanian19-Aug-08 3:11
professionalRajesh R Subramanian19-Aug-08 3:11 
GeneralRe: Where should I post queries about Windows Drivers? Pin
Roger Stoltz19-Aug-08 3:18
Roger Stoltz19-Aug-08 3:18 
GeneralRe: Where should I post queries about Windows Drivers? Pin
Rajesh R Subramanian19-Aug-08 3:30
professionalRajesh R Subramanian19-Aug-08 3:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.