[SDL] multithreading problem

Frank Becker crittermail2005 at telus.net
Sun Dec 31 10:14:19 PST 2006


karx11erx wrote:
> Maybe this is not the perfect place to post this question, but as it
> has at least losely to do with SDL, I'll do it anyway. :)
> 
> I have multithreaded some CPU intensive code in my renderer using SDL.
> That code really *is* CPU intensive - it can cut down framerates by 75%,
> so I expected to really see some performance gain on multicore CPUs if
> splitting it in two threads.
> 
> The threads are started at program start and wait for data to process.
> The thread execution process is pretty finegrained though (i.e. the
> threads are signalled to start pretty often and do not process all that
> much data before finishing and waiting for the next start signal). Due
> to the entire structure of the renderer this can hardly be changed.
> 
> I have a dual-core AMD CPU, and the device manager shows two CPUs. Yet,
> with fully optimized release code, the dual-threaded execution is about
> 25% percent slower than the single-threaded one.
> 
> Any clues to why this is so (e.g. too fine grained) or what I am doing
> wrong (i.e. second core not recognized)?
> 

Since you are wondering where your app is spending its time, how about 
running it through a profiler?

Cheers,
--
Frank Becker - Need a break? http://criticalmass.sf.net/




More information about the SDL mailing list