Subj : Re: Challenge: Multithreading & Synchronization To : comp.programming.threads From : Uenal Mutlu Date : Wed May 18 2005 07:45 pm "Joe Seigh" wrote > On Wed, 18 May 2005 14:05:47 +0200, Uenal Mutlu <520001085531-0001@t-online.de> wrote: > > > /* > > Here's a real-world synchronization challenge for accessing shared data > > from multiple threads (some call this "thread synchonization"): > > > > 1) A server application uses threads to serve clients. > > 2) It uses a thread per connected client. > > 3) There can be as many as 1000 or even more clients. > > 4) It uses a shared instance of a class to serve the clients. > > 5) The class has three data members: vSD, vJD, vMD (all independent of each other) > > 6) Each of the member functions can make calls to each other. > > 7) Each of the member functions can query and/or modify the data (see also 8). > > 8) The list of data objects queried or modified in each function is given in > > each function header (for further details see code skelleton below (class Server)). > > > > Sorry, it's not sufficiently interesting. Seems like a rather contrived example to > make a point about what is a self inflicted problem. An experienced multi-threaded > programmer would never design such a mess. And if the mess was a pre-existing > mess, it would be beyond refactoring. The problem domain should be clear. That is: we have a class with 3 vectors. A global instance of this class is used to server multiple threads. IMO an every day task. Just curious: how would you personally formulate the problem? .