• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            牽著老婆滿街逛

            嚴(yán)以律己,寬以待人. 三思而后行.
            GMail/GTalk: yanglinbo#google.com;
            MSN/Email: tx7do#yahoo.com.cn;
            QQ: 3 0 3 3 9 6 9 2 0 .

            Game Engine Planning

            Over the past couple of months I have been reading a lot about writing games and engines for multiprocessor machines and it is definately a non-trivial problem! It is complicated even more if you want to make full use of the processors on most home computers (currently single-core), the Xbox360 (Triple-Core with two hardware threads per core) and the PS3 (Cell-Processor)! From what I have been reading there are many ways to get use of multiple processors. The simplest, if you have an already existing codebase is called Synchronous Functional Parallel and looks like this:

            The idea is to take parts that are easily independant and break them off into their own thread. The hard part is to pull the bits out of an existing system and make then run in parallel. It is also unlikely that you are going to find that many things to run at the same time so you would make use of only 1 or 2 of the processors and even then the time for the cycle would be dictated by the longest running process since each process needs to resync each frame so you could, in theory, spend quite a bit of time waiting. The next possible configuration is called Asynchronous Funtional Parallel.

            The down side of this method is that it would require almost a complete rewite if you had an existing engine. We don't so this is not a problem for us! The benefits are that you don't need to sync the threads each frame so each one can run independantly and any time one thread needs to interact with another thread it would just grab the latest state of that thread. This may cause threads to use old information from other threads, but you would only be behind 1 or 2 frames and that shouldn't be noticable. A downside that we would need to be concerned about is the fact that there are a limited number of tasks that you can break your engine into. For example if you look at the picture, there are three. If we had a quad-core processor the fourth core would be completely unutilized! Another way to do threading is to break things up according to the data being processed instead of the tasks that need to be done. This is called Data Parallel.

            As you can see this is a somewhat synchronous approach in that each thread must finish before it enters the rendering stage. That means that again the time that section takes is dictated by the thread that takes the longest. The biggest benefit here is that you can break this up over an arbitrarily large number of processors and have them all fully utilized, a down side is that things can get pretty complex if the objects in your game need to interact. It's not unmanagable, but it's something that will require quite a bit of thought to get right!

            In reading an article about the rewrite of Valve's Source Engine they say that they have decided to use a Hybrid solution but they don't go into the details as to what it looks like. I think that the best hybrid would be to have something that looked like the Asynchronous Functional Parallel and then break each function down into data objects.

            This would allow the function to be sort of a Data Object Manager and it could break them up as it saw fit. Or example in the Physics function it may choose to break the objects into chunks by area so that the objects that are most likely to interact are in the same thread. This would have the synchronous issue where the time to execute would be dictated by the longest execution time, but it would only be in that function and not compuded by each function and so should be less noticable. It also has the benefit that it can be scaled across an arbitarily large number of cores.

            I would really like to get peoples opinion on this last setup as it's the one that I am leaning towards using.

            posted on 2007-01-28 20:37 楊粼波 閱讀(162) 評論(0)  編輯 收藏 引用


            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            亚洲国产精品成人久久蜜臀 | 99久久综合狠狠综合久久| 日产精品99久久久久久| 久久亚洲精品成人av无码网站| 亚洲国产精品无码久久久蜜芽| 色综合久久综精品| 亚洲国产天堂久久综合| 久久久久亚洲av无码专区导航| 久久精品国产色蜜蜜麻豆| 中文字幕热久久久久久久| 欧美激情精品久久久久| 伊人久久成人成综合网222| 国产V综合V亚洲欧美久久| 久久久网中文字幕| 91久久香蕉国产熟女线看| 亚洲女久久久噜噜噜熟女| 91精品国产91久久久久久| 久久久久亚洲av成人网人人软件| 久久久久久国产精品无码下载| 九九精品久久久久久噜噜| 99久久精品免费国产大片| 久久天天躁狠狠躁夜夜2020一| 热久久国产精品| 亚洲AV无码久久精品蜜桃| 久久久久噜噜噜亚洲熟女综合| 欧美亚洲色综久久精品国产| 色婷婷久久综合中文久久一本| 久久精品国产一区二区三区| 69SEX久久精品国产麻豆| 久久免费视频观看| 久久久久AV综合网成人| 色欲综合久久躁天天躁蜜桃| 久久久国产亚洲精品| 亚洲国产婷婷香蕉久久久久久| 一本色道久久88加勒比—综合| 精品国际久久久久999波多野| 97精品依人久久久大香线蕉97| 伊人久久亚洲综合影院| 性做久久久久久久久久久| 久久久久99精品成人片牛牛影视| 久久黄色视频|