First of all I have to ask: Have you *ever* written multi-threaded code? And I don't mean the basic 'background worker thread' model, but a *real* industry-grade design. I don't mean to that to be offensive, it's just I get a real feeling from your posts that you've read up a bit about MT but never really done it in practice.
Sorry, I should have said: you cannot write software to run a specified amount of work on an unspecified number of threads. Games run a specified amount of work, that cannot be efficently split over an unspecified number of threads.
WTF?
![Confused :confused: :confused:](/styles/default/xenforo/vbSmilies/Normal/confused.gif)
Are you reading *anything* I write or just completely ignoring it? Again I don't mean to spark an argument here but you seem to be just spitting back what I write in my face without so much as an explanation.
Any thread - at any given time - is only working on one thing.
Said the Computer Science 101 student
Ok, game server's I'll give you
Nope, *full games* (not just their server side) are written with an ICOP "work unit" design these days. See Crysis, Eve Online etc.
Massively parallel and "truly scalable threading model" are the same thing; the only difference is in the load spreading. Threads are a form of simulated parallel programming (or, if they end up running on different cores, genuine parallel programming) - the techniques and challenges are very similar.
"only difference is the load spreading"? How on earth can you know that when those design names reveal nothing about their underlying implementation and finer design details?
There's no basic difference between creating a new thread and re-using an old thread. You still end up with the same situation. Games contain few opportunities to have genuine seperability in function, and fewer where time is freely constrained and are thus poor candidates for seperability.
Creating a thread is very expensive on NT. Very very expensive. It locks the thread scheduler and needs memory allocation, in short it's not something any application should do at any time other than startup.
I can think of plenty of opportunities where a game can gain parallelism advantages. Like before, one (lesser) game might just have a RenderFrame work unit. Another better game might have a more finer scale RenderObject work unit. That way it can dispatch several RenderObject work units and have them processed on multiple CPUs/cores and then when they are done it can fire off a RenderFrame work unit which takes those works and combines them into a single scene. There might also be a RenderEffect work unit which can render all the pixel shaders and such like. That is just breaking the ice as well, games are practically infinitely optimisable on a multi threaded platform with a good design underneath.
IOCP works because of the environment it works under - namely where work is requested on an effectively random basis by an external source - this is not the case under which games (game servers excepted) operate.
So 5 mins ago you didn't know what IOCP was and now you are educating me on it?
![Confused :confused: :confused:](/styles/default/xenforo/vbSmilies/Normal/confused.gif)
I would have a game's loading type if quite random. Not that it matters though. I'm not quite sure how the IOCP's
type of load would be any different to what a lesser design has to do. It's just different means to an end - one of which (IOCP) is faster, more maintainable, more elegant and more scalable than the other.
Which is all very well when you have seperable freely orderable objects. That is rarely the case in games. Render order is very important, more so when you throw in transparency. What's more delivering the output of that work into their destination is also time critical and order dependent.
Any multi threaded design is inherently "out of order". IOCP is no exception. Luckily multi threaded programmers have plenty of ways to bring order back into the design. Lock-free queues being the prime example as used in server software for years and now being used in upcoming multi threaded games.