Re: [GD-General] profiling multi threaded applications
Brought to you by:
vexxed72
From: brian s. <bri...@gm...> - 2005-07-20 21:10:04
|
Andras, are all of your threads doing the same thing? Otherwise, a critical= =20 section won't do anything for you. If only one thread tries to acquire the= =20 object, it will (trivially) always get it. Now, if you're thinking going to put this critical section at the top level= =20 of your app and make all threads go through it, then you're back to=20 Christian's suggestion: If possible, design your architecture so that your threads can work in a lockstep mode, with one central mutex controlling which thread is running a= t any given moment. That way you can at least get a partial profile and optimize each thread individually. This type of design can also prove very useful to debug deadlocks. --brian On 7/20/05, Lewin, Gareth <gl...@ea...> wrote: >=20 > That shouldn't be a problem, I assumed your START and END pairs can be > nested. >=20 > From MSDN: >=20 > After a thread has ownership of a critical section, it can make > additional calls to EnterCriticalSection or TryEnterCriticalSection > without blocking its execution. This prevents a thread from deadlocking > itself while waiting for a critical section that it already owns. The > thread enters the critical section each time EnterCriticalSection and > TryEnterCriticalSection succeed. A thread must call LeaveCriticalSection > once for each time that it entered the critical section. >=20 > > -----Original Message----- > > From: gam...@li... > > [mailto:gam...@li...] On > > Behalf Of Andras Balogh > > Sent: Wednesday, July 20, 2005 1:50 PM > > To: gam...@li... > > Subject: Re: [GD-General] profiling multi threaded applications > > > > Yeah, I have something similiar, except that it's > > hierarchical, so START and END can be nested, in which case > > it gets a bit trickier to use CriticalSections, but I think I > > could give that a try! > > > > thx, > > > > Andras > > > > Lewin, Gareth wrote: > > > You could have your START and END macros (I assume you use > > something > > > like that) include EnterCriticalSection and LeaveCriticalSection > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by: Discover Easy Linux Migration > > Strategies from IBM. Find simple to follow Roadmaps, > > straightforward articles, informative Webcasts and more! Get > > everything you need to get up to speed, fast. > > http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op=3Dclick > > _______________________________________________ > > Gamedevlists-general mailing list > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-general > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=3D557 > > >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&opclick > _______________________________________________ > Gamedevlists-general mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-general > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_idU7 > |