[SDL] multithreading problem

karx11erx karx11erx at hotmail.com
Sun Dec 31 03:09:48 PST 2006


Spencer Salazar <ssalazar <at> CS.Princeton.EDU> writes:

> 
> 
> On Dec 31, 2006, at 1:17 AM, karx11erx wrote:
> 
> > My CPU has 1 MB of CPU cache, and afaik that is per core
> 
> it seems to me like you are using two threads to solve a one thread  
> problem.  The fact that you made thread execution so fine-grained  
> highlights this.  threads aren't a panacea, even on a multi-processor/ 
> multi-core system.  so i would either revise the threaded code to  
> involve less signaling and/or shared data, or improve the efficiency  
> of the original single-threaded algorithm if possible...  hope this  
> is of some help but sorry if its not.
> 
> spencer
> 

I don't think this is a one-thread problem. It is parallelizable, there are few
memory accesses, but a lot of 3D math. What I think is that the thread
management overhead is so expensive that it costs more than what parallel
execution save in execution time. Achieving a speedup if using the unoptimized
debug code is suggesting that.







More information about the SDL mailing list