Re: [Algorithms] Multithreading with Hardware Acceleration
Brought to you by:
vexxed72
From: Timur D. <ti...@3d...> - 2000-08-21 10:40:03
|
SwitchToThread only supported on NT and 2k, good enough reason to not use it in games. _______________________ Timur Davidenko. 3Dion Inc. (www.3dion.com) e-mail: ti...@3d... ----- Original Message ----- From: "Matt Adams" <de...@gm...> To: <gda...@li...> Sent: Monday, August 21, 2000 12:03 PM Subject: RE: [Algorithms] Multithreading with Hardware Acceleration > btw, why is everyone using sleep(0) instead of switchtothread ? > since some of my threads do have an different priority, it seems > to be better to give (especially the higher-priority threads ) > part of the regained time, too. > Are there disadvantages in using switchtothread (is it slower, etc.) ? > > Matt > > -----Original Message----- > From: gda...@li... > [mailto:gda...@li...]On Behalf Of Tom > Forsyth > Sent: Montag, 21. August 2000 07:13 > To: gda...@li... > Subject: RE: [Algorithms] Multithreading with Hardware Acceleration > > > The Sleep(0) explicitly gives up the rest of the thread's timeslice to other > threads. So even if two threads are at the same priority, the other one will > get most of the CPU time, instead of spending half of it spinning tightly. > It's a way of surrendering time you don't need - sort of manually lowering > your priority, but with very fine-grained control. > > Tom Forsyth - Muckyfoot bloke. > Whizzing and pasting and pooting through the day. > -----Original Message----- > From: Chris Brodie [mailto:Chr...@ma...] > Sent: 21 August 2000 05:50 > To: 'gda...@li...' > Subject: RE: [Algorithms] Multithreading with Hardware Acceleration > > > Thanks guys. I was only planning on about ~3-4 threads(input+networking, > file, video, main, (sound?)) > Each thread has a threadsafe queue. Then to communicate with it I just send > it a message throught the queue(like a pointer to where the data is it need > to do it's work. > I was once playing with WildTangets Gamedriver and profiled the 'explore' > sample app to see where all the CPU time went. Just about all of it was > spent in the nVidia driver, so I was betting that they were just doing a > whole bunch of waits as bits were being rendered. > Tom, while your way is correct (sleep(0) to return control to the OS to > reschedule), and is a nice way of doing it, shouldn't the scheduler still > switch to another thread if one is waiting and is of the same or higher > priority? > The reason I'm interested in this is that it'll give gains on single > processors as well as the dual's. > Chris > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |