Click here to Skip to main content
15,916,180 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Impact of synchronization on application performances Pin
Ahmed Charfeddine19-Aug-08 6:16
Ahmed Charfeddine19-Aug-08 6:16 
GeneralRe: Impact of synchronization on application performances Pin
Ahmed Charfeddine19-Aug-08 22:12
Ahmed Charfeddine19-Aug-08 22:12 
AnswerRe: Impact of synchronization on application performances Pin
Roger Stoltz19-Aug-08 22:46
Roger Stoltz19-Aug-08 22:46 
GeneralRe: Impact of synchronization on application performances Pin
Ahmed Charfeddine19-Aug-08 22:53
Ahmed Charfeddine19-Aug-08 22:53 
AnswerRe: Impact of synchronization on application performances Pin
Roger Stoltz19-Aug-08 23:39
Roger Stoltz19-Aug-08 23:39 
GeneralRe: Impact of synchronization on application performances Pin
Ahmed Charfeddine20-Aug-08 0:16
Ahmed Charfeddine20-Aug-08 0:16 
GeneralRe: Impact of synchronization on application performances Pin
Roger Stoltz20-Aug-08 4:33
Roger Stoltz20-Aug-08 4:33 
GeneralRe: Impact of synchronization on application performances Pin
Ahmed Charfeddine20-Aug-08 5:54
Ahmed Charfeddine20-Aug-08 5:54 
Roger, if I have to do it that way, then I will also have to find mechanism on how to hold copies of many other variable attributes for evry thread (8 threads), and how to inform the threads of their values changes.
The application is a real time chess server, (ie for blitz play) and there are much attributes and references like the CPlayer::name :players elos, games moves, players running games,challenges time property,game brodcasts participants, tournament properties etc..many many.All of them I have to ensure that concurrent access to would not cause application crash or unbearable values incorrectnesses.I am really in a big scenario.

Well indeed, I confirm this second article you supplied : optimzation can easily lead me to contradict the abstractions I've done, or I should do.

It is already that even if I choose your previous solution according to which local copies of critical data attributres are hold by the concurrent threads, then I will have to violate data visibility and it will be like synchronization a certain member x is solved elswere its class extent, such that if I encounter other synchronization issue in other contexts (I have other threads than the worker threads taht are running too) then I will have to rewrite syn mechanism.


I think I will have to content myself with CriticalSection and only hiding synchrobnization within the scope of class member functions .


No, I nolonger can endure to change the container for my data : reading this std::map again only dazzles me to using it.

I didn't know about the use of hashing inside map container.

I already using hashing client-side when you choose to play a local chess game against the computer, rather than on the server : the chess algorithms keeps track of searched positions assements numbers not by recording the whole position (what piece on evry square) along with the numbers, but rather by storing a signature of the position against the actuall assesment number..becuase the tree of chess position always contains repetitions.

Instead of the maps, maybe I think of implementing hashing, in order to make getPlayerByName very quick, but I will preserve my stack table.
Indeed I didn't know that hashing will bring significant performance here. I didn't even believe that this is a context for it : now that I see it is implemented in stadard lib ! Becuase in chess, the number of positions generated is so big (mesured in KNps : kilo Nodes per soconds) that indeed the consequence is that the time spent on the would-be compare function would be non negligeable when it is accumulated. But eventually we want access to the assesment number of the position serached becuase it is the most costly number to generate in terms of time.

Any way I have developed a sort of dhashbord, ie remote monitor for the server performances by collecting key counters and feature values and I will make sure to implement the many solutions in hand and vizualize the results.
I share with you its picture, and I am going home now becuase my head is as if split in two, one part becuase of DirectShow and the other becuase oif thread synchronisation.

http://farm4.static.flickr.com/3014/2655919984_7fa6d4ee3c.jpg?v=0[^]

Our Philosophy, Mohammed Baqir Al Sadr

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 
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 

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.