View Poll Results: Is your code Multi-threaded or Multi-Core enabled

Voters
21. You may not vote on this poll
  • It's all Single core and Single Threaded

    11 52.38%
  • It's Single Core but Multi-Threaded

    4 19.05%
  • It's Multi-Core and Multi-Threaded ( I'm a shit hot programmer )

    6 28.57%
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: Multi-core/Multithreading your engine...

  1. #11

    Multi-core/Multithreading your engine...

    My CBCFoundation is single threaded. But it's a 7yr old engine now.

    I agree that new stuff should be multi-threaded to take advantage of advances in CPU design without massive code changes. But it's not a simple case of just using threads.. it's a mindset shift in design and debugging techniques.

  2. #12

    Multi-core/Multithreading your engine...

    I have been experimenting with Multi-Theading for for the Genesis Device engine for a while now. My current setup has threads for rendering, physics, input and sound.

    I haven`t had much performance increase though. With a single thread 95 % of my CPU time wen`t to the renderer. This is basicly the same in my multi thread setup since input and physics have to wait on the renderthread and visa versa. Probebly Ill split the renderer in different threads also. Like updating animations, calculate scene visibility and finally of course the rendercalls.

    What I have discovered is that xp and vista do a pretty good job of distributing the threads accross my 2 cores. XP does 2 threads per core, vista does the renderthread on one and the remaining 3 on the other core.

    Also I have found a interesting articale on how valve made there engine multi threaded.

    http://techreport.com/articles.x/11237

  3. #13

    Multi-core/Multithreading your engine...

    Quote Originally Posted by NecroDOME
    How can I say for example that thread 1 needs to run on core 1 and thread 2 on core 2? this would be a nice feature.
    That's what SetAffinity does

    http://msdn2.microsoft.com/en-us/library/ms686247(VS.85).aspx

  4. #14

    Multi-core/Multithreading your engine...

    In our case, Wicked Defense (including incoming v1.5 release) and another project we are developing are all single-threaded.

    These games aren't CPU extensive, so they can run on P3 1.12 Ghz with an average of 50% CPU usage. The graphics, however, is another question. Do we have multi-core GPUs already (that aren't SLIs)?

    Another challange is Direct3D DrawPrimitive overhead, which even with instancing increases CPU usage and reduces the performance, and is not solved on multi-core CPUs. We have yet to see if DX10 reduces this problem at least partially.

  5. #15

    Multi-core/Multithreading your engine...

    Quote Originally Posted by Luuk van Venrooij
    Also I have found a interesting articale on how valve made there engine multi threaded.

    http://techreport.com/articles.x/11237
    Very interesting article. I remember reading about free-lock algorithms in a Game Programming Gems, now I'm reading a little more:

    http://en.wikipedia.org/wiki/Lock-fr...Implementation

    Is there a way to access those atomic primitives in Delphi or even better in FPC, in a multiplatform manner? :?

  6. #16

    Multi-core/Multithreading your engine...

    cronodragon: EnterCriticalSection()/TryEnterCriticalSection()?

  7. #17

    Multi-core/Multithreading your engine...

    Quote Originally Posted by Mirage
    cronodragon: EnterCriticalSection()/TryEnterCriticalSection()?
    "Waits for ownership of the specified critical section object. The function returns when the calling thread is granted ownership.... The threads of a single process can use a critical section object for mutual-exclusion synchronization"

    I'm not sure that is the same as this:

    "...atomic primitives that the hardware must provide..."

    Critical sections are implemented by the system, while atomic primitives are implemented in the hardware, right? :? It seems they do a similar effect, but the idea is that lock-free is only ONE atomic operation, that means speed.

  8. #18

    Multi-core/Multithreading your engine...

    I've always understood critical sections to be an equivalent to semaphores. I haven't understood the difference between the techniques "atomic operations" and semaphores. Most semaphores are implemented using bus locking anyways, which is what atomic operations use too.
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  9. #19

    Multi-core/Multithreading your engine...

    Quote Originally Posted by cronodragon
    "Waits for ownership of the specified critical section object. The function returns when the calling thread is granted ownership.... The threads of a single process can use a critical section object for mutual-exclusion synchronization"
    This is about EnterCriticalSection right? See TryEnterCriticalSection description. AFAIK it's implemented using system InterlockedCompareExchange function which is implemented via CMPXCHG.
    In FastMM sources used CMPXCHG assembler instructions.

  10. #20

    Multi-core/Multithreading your engine...

    What about an Event Based Asynchronous Pattern - http://msdn2.microsoft.com/en-us/library/ms228974.aspx?
    Sound like it could be useful, but not sure how practical it would be in game.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •