MultiCore / MultiThreaded games

schkorpioschkorpio I can mspaint Join Date: 2003-05-23 Member: 16635Members
I just read some stuff saying that programming is really difficult for multicore games as usually one core has to wait for another core to finish so that the processes can be sync - e.g. when the gun shoots, the sound is played at the right time.
So from what i gather they are using all of the cores individually - but my question is why don't they just write some kind of middleware which will make a quad core cpu look like one really fast single core cpu to the game? E.g. instead of seeing a quad 2.4ghz cpu a game would see a single 9.6ghz cpu ? The middle ware could split the calculations over the 4 cores so in theory each one would only work 1/4 has hard as it had to?

Or is something like this impossible? anyone know?

Comments

  • KungFuDiscoMonkeyKungFuDiscoMonkey Creator of ns_altair 日本福岡県 Join Date: 2003-03-15 Member: 14555Members, NS1 Playtester, Reinforced - Onos
    edited September 2007
    You would still have to write some kind of synchronization code somewhere and writing multi-threaded code is hard no matter where in the software you write it. If things were easy, it would have likely already been done.
  • douchebagatrondouchebagatron Custom member title Join Date: 2003-12-20 Member: 24581Members, Constellation, Reinforced - Shadow
    in my operating systems class we are just beginning to discuss this, and the problem lies in 2 different cores accessing the same memory and changing it, causing the memory to come out wrong at the end. it can be covered in the code, but im not sure if a middleware type program would be able to make this work since the code itself would have to be written to prevent other threads from accessing the memory at the same time.
  • KungFuDiscoMonkeyKungFuDiscoMonkey Creator of ns_altair 日本福岡県 Join Date: 2003-03-15 Member: 14555Members, NS1 Playtester, Reinforced - Onos
    We had a homework assignment for my OS class that used semaphores. It was a 200 point homework that was delayed indefinitely at one point then we finally got a deadline that it was due in a week. The average grade for that homework was a 90. 80 points of that homework was answering some book questions. 120 points of that homework involved writing a simple system with two shared resources. Out of those 120 points, 30 was a simple client server thing (we had multiple clients connecting to a server). The next 30 involved writing a shared worker queue. A client would connect to the server and be assigned a worker from the queue. Each worker had to be able to access this queue to accept one of the client connections. I don't think a lot of people in our class got that one working. The last 30 points involved the workers taking a variable number of resources from a shared resource pool. I don't think anyone got that one right.
  • [WHO]Them[WHO]Them You can call me Dave Join Date: 2002-12-11 Member: 10593Members, Constellation
    Yeah, it's tricky. Especially when trying to track down bugs.
Sign In or Register to comment.