Results 1 to 3 of 3

Thread: Dual-Core

  1. #1
    Join Date
    Apr 2007
    Beans
    2,042

    Exclamation Dual-Core

    How do I take advantage of the dual-core when programming in C++?
    Would someone show me an (as simple as it can get) example of how to achive this?
    Going to make a 3D game and need horsepower.

  2. #2
    Join Date
    Feb 2005
    Location
    Sweden
    Beans
    10
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Dual-Core

    You need to create a multithreaded program. For example, if you're creating a game you can use an extra thread for networking, or one for loading stuff from disk in advance (for example maps), etc.

    If you're new to programming you should NOT start with threading. Threading is hard, you need to do synchronization between your threads because they can't use the same data (variables) at the same time, and you must check that all code (libraries etc.) you use is thread-safe and that you use it in a thread safe way.

    You can use the Boost library to get threading in your program:
    Getting started with Boost
    Boost.Thread

    Or you can use SDL for threading. I don't know which one is better because I've only done threading in C with pthreads.

    Btw, I'm just guessing, are you coding an entry for the intel challenge?

  3. #3
    Join Date
    Apr 2007
    Beans
    2,042

    Re: Dual-Core

    I just learnt SDL so that would be cool!

    No I'm not actually hehe This project will take longer time...

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
  •