View Single Post
Old Feb 14, 2013, 10:56 AM   #85
FordGT90Concept
"I go fast!1!11!1!"
 
FordGT90Concept's Avatar
 
Join Date: Oct 2008
Location: IA, USA
Posts: 10,574 (6.29/day)
Thanks: 1,752
Thanked 2,596 Times in 1,960 Posts

System Specs

Quote:
Originally Posted by hellrazor View Post
But wasting 3 or 5 or 7 cores is totally effiecent, whatever you say.
Assuming there is more than one logical processor in the first place. If there isn't, you added inefficiency in the name of efficiency!


Quote:
Originally Posted by Aquinus View Post
Also to your queue argument. You need to lock down the queue every time you push or pull an item out of the queue because you're altering it and a race condition wouldn't just be bad for the application, it could corrupt the queue.
A main thread could manage the queue (push work on and pop it off to be sent to another thread) but if those results have to come back in the same order they were sent (which should, because why else would you be using a queue?) multithreading the queue will be a disaster.


FYI, instead of locks, I use events so instead of locking memory by a thread, I always make the thread that owns it perform the update. The weakest link becomes the main thread though because if it gets spammed with work to do by worker threads, the whole thing slows to a crawl (the main thread and all of the worker threads).
__________________
Golden Rule of Programming: Never assume.

try { SteamDownload(); }
catch (Steamception ex) { RageQuit(); }

Last edited by FordGT90Concept; Feb 14, 2013 at 11:06 AM.
FordGT90Concept is offline  
Crunching for Team TPU
Reply With Quote