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 1 of 3 123 LastLast
Results 1 to 10 of 28

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

  1. #1

    Multi-core/Multithreading your engine...

    So how many people here have switched their engines to take advantage of the extra cores that people have in their machines and also multple threads?

    I'm looking for a working example of a multi-core/multi-threaded gaming example.

    Any links, tips etc welcome.
    <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 =-

  2. #2

    Multi-core/Multithreading your engine...

    The multicore bit doesn't make that much sense to me. Multithreaded apps have the possibility of running simultanously so there shouldn't be any difference except for that you have to make absolutely sure that you lock shared variables correctly.
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  3. #3

    Multi-core/Multithreading your engine...

    Multicore to me means running on more than one processor.
    So you could have 3 threads on processor 1 and 3 threads on a second processor. Multicore processor have more than 1 processor on the die. At least that is my understanding of it all.
    <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 =-

  4. #4

    Multi-core/Multithreading your engine...

    Quote Originally Posted by savage
    Multicore to me means running on more than one processor.
    So you could have 3 threads on processor 1 and 3 threads on a second processor. Multicore processor have more than 1 processor on the die. At least that is my understanding of it all.
    Well it still doesn't makes any difference to me. If your game is safely multithreaded then it should automatically have the ability to run on more processors simultanously.

    The interesting part to me is how many threads is the most optimal number. From a slideshow from a microsoft game developer I've read that the most optimal seems to have a main gamelogic+renderthread, one thread for network communication, one thread for file operations and decompression and one optional for physics. This according to him should match the biggest number of machines(pc's, xboxes, etc) most efficiently.
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  5. #5

    Multi-core/Multithreading your engine...

    Dom

    the InfinitEngine is in the process of getting MultiCore support. I've found that free pascal does not support Thread Affinity "out of the box" but then again Delphi doesn't either. Bui'm testing the api for this under Windows, Mac and Linux.

    the main reason for adding support for multi cores is that on most operating systems any threads created in the main process will only run on the CPU on which the process is running. So if you want to spread the load across all CPU's (you might have 4) you have to do some fiddling yourself.

    Windows does seem to create threads across CPU's already, but historically is not very good at balancing.

    To even things out the InfinitEngine will have it's own Thread Manager, which will just keep track of the number of threads the app has on each CPU, and balance them out so each CPU has the same number of threads. Hopefully this will allow the engine to take advantage of multiple cpu's but still work fine on systems with one CPU.

    Dean
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  6. #6

    Multi-core/Multithreading your engine...

    Although I have used AMD processors for many years, I bought an Intel Dual Core 2 for my last computer upgrade, and I have had plenty of problems with it As I use some application it gets slower and slower with time. I can restart and power off the computer, and the application remains slow. With the sysinternal's process explorer I can see how the application's process load increases to the top. I have downloaded the latest drivers, re-flashed the BIOS, and tested the processor with the Intel diagnostic tools and I still can't find the damn problem, which I think is the processor itself, that does some sort of buggy thread balancing.

    Anyway, I have been able to deal with those nasty problems, and I was able to make my engine multi-threading. I reserve a thread for the game loop with SetAffinity, but I don't have any demos yet. I have future plans for a multithreading virtual machine for the engine's programming language.

    By the way, I have had success when synchronizing the VCL, but no luck with the LCL. Does anyone have the same problem? :?

  7. #7

    Multi-core/Multithreading your engine...

    Quote Originally Posted by cronodragon
    ..., which I think is the processor itself, that does some sort of buggy thread balancing.
    That, good sir, is the job of the operating system

    I haven't actually worked with affinity masks before. Wouldn't you risk a lot of cache missing? I don't know how it actually works on windows
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  8. #8

    Multi-core/Multithreading your engine...

    single thread
    From brazil (:

    Pascal pownz!

  9. #9

    Multi-core/Multithreading your engine...

    Today's engine should be multithreaded. There is no choise.
    While designing my engine I kept in mind parallelism and soon I'll implement it without too much effort.

  10. #10
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Multi-core/Multithreading your engine...

    My whole engine is currently multi threaded (and you can also run it on one single thread as extra option)
    But single core I think.

    A question: is multi threaded not directly multi core (processor) supported?

    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.
    NecroSOFT - End of line -

Page 1 of 3 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
  •