Dual Core
Moderator: Moderators for English X Forum
-
- Posts: 14933
- Joined: Tue, 12. Nov 02, 00:26
-
- Posts: 167
- Joined: Sat, 27. Dec 03, 02:26
I might be wrong here, but:
isn't it just a case of running the economy in one thread, and then haveing the visuals run in a second thread, and letting the operating system deal with the actual details of allocating the computational resources?
Of course you would have to deal with the complications of both threads trying to access the same resources as to what the game engine should do and what the visuals should display.
isn't it just a case of running the economy in one thread, and then haveing the visuals run in a second thread, and letting the operating system deal with the actual details of allocating the computational resources?
Of course you would have to deal with the complications of both threads trying to access the same resources as to what the game engine should do and what the visuals should display.
-
- Posts: 699
- Joined: Wed, 6. Nov 02, 20:31
that's down to Signls if i remember corectly, which is what you use when developing for multi-proc systems, basicaly locks a rescource while it's in use by a process and causes the other to wait for it's release.Of course you would have to deal with the complications of both threads trying to access the same resources as to what the game engine should do and what the visuals should display.
Flying around in my disco-mobile
[ external image ]
[ external image ]
-
- Posts: 41359
- Joined: Wed, 6. Nov 02, 20:31
Windows uses a mechanism called mutexes for the same thing. However, the single simple sentence Sabo wrote (complications of both threads having to access the same resource at the same time) is a MASSIVELY difficult job when you're actually coding, believe me. It isn't helped by the fact that any bug often shows up as a "race condition"--e.g. where the program works fine if one thread gets to the resource first, but does something unexpected if the other one gets it first. In the worst case scenario this can lead to a deadlock where both threads are waiting for each other to finish processing before they can continue, which isn't something you want to happen in the middle of the game!soimafreak wrote: that's down to Signls if i remember corectly, which is what you use when developing for multi-proc systems, basicaly locks a rescource while it's in use by a process and causes the other to wait for it's release.
-
- Posts: 3285
- Joined: Tue, 28. Dec 04, 02:19
-
- Posts: 3535
- Joined: Thu, 4. Dec 03, 17:16
-
- Posts: 71
- Joined: Sat, 6. Nov 04, 17:06
-
- Posts: 3276
- Joined: Mon, 2. Aug 04, 22:27
-
- Posts: 9966
- Joined: Sat, 31. Jan 04, 14:38
Easily.JihadJoe wrote:the budget minded daul cores of intel are pretty much affordble (starting for 200$ I think).
but the ones of AMD start from 400 $ for the cheapest model (4200+)
in about a year,there WILL be a mainstream CPU from both compenies.......
In 2 years we'll probably have like Quad Cores, or be running several side by side processors.
Can't wait!
-
- Posts: 699
- Joined: Wed, 6. Nov 02, 20:31
I made a mistake what i should have said was semaphores; signals are a unixy thing only i think (like SIGHUP)
http://utopia.poly.edu/~snaray01/paraproc.html
however i can't remember the name of the guy who basically came up with an almost perfect system, but can't rememebr what was wrong with it.
basicly it sets one to be able to access and one unable to access it in a bool var. the one that can't access it get's trapped in a infintae loop until it's set to allowed to access the memory. the one that is trapped in the infinate loop stays there until the process that can access the memory has done so and is about to jump out of the if statement where it set's it's self to unable to access the data and the other process is then set to be allowed to access the memory and so on
i know it's the worlds muckiest description but that's all i can remember from my operating systems lectures llast winter
http://utopia.poly.edu/~snaray01/paraproc.html
however i can't remember the name of the guy who basically came up with an almost perfect system, but can't rememebr what was wrong with it.
basicly it sets one to be able to access and one unable to access it in a bool var. the one that can't access it get's trapped in a infintae loop until it's set to allowed to access the memory. the one that is trapped in the infinate loop stays there until the process that can access the memory has done so and is about to jump out of the if statement where it set's it's self to unable to access the data and the other process is then set to be allowed to access the memory and so on
i know it's the worlds muckiest description but that's all i can remember from my operating systems lectures llast winter
Flying around in my disco-mobile
[ external image ]
[ external image ]
-
- Posts: 1728
- Joined: Thu, 11. Mar 04, 10:37
Yea. They have pretty much pushed the clock speed up to the limit with their current technology, so that leaves them only one option and that is to go sideways. There aren't any multi threading games out there right now but I think we'll see them show up soon.Tsar_of_Cows wrote:In 2 years we'll probably have like Quad Cores, or be running several side by side processors.
Can't wait!
However as far as my limited knowledge in this stuff goes porting an existing game to multiprocessor / multicore is probably more of a hassle then writing the whole thing from scratch!Sabo wrote:isn't it just a case of running the economy in one thread, and then haveing the visuals run in a second thread, and letting the operating system deal with the actual details of allocating the computational resources?
What I'm wondering is, there will probably be more and more cores in new CPUs, so how will the programmers write codes that will handle varying number of threads?
"WhiskeyCorp - The universe's local monopoly" (TM)
-
- Posts: 699
- Joined: Wed, 6. Nov 02, 20:31
http://en.wikipedia.org/wiki/Semaphore_(programming)
turns out it was Edsger Dijkstra who worked it out, he's the guy we thank today for routing algorithms. which without we wouldn't be here now doing this... well not as well anyway
turns out it was Edsger Dijkstra who worked it out, he's the guy we thank today for routing algorithms. which without we wouldn't be here now doing this... well not as well anyway
Flying around in my disco-mobile
[ external image ]
[ external image ]
-
- Posts: 1520
- Joined: Thu, 21. Oct 04, 15:14
The fact that the upcoming Xbox 360 and PS3 will have multi-processors will only accelerate the trend.Charlie Whiskey wrote:Yea. They have pretty much pushed the clock speed up to the limit with their current technology, so that leaves them only one option and that is to go sideways. There aren't any multi threading games out there right now but I think we'll see them show up soon.Tsar_of_Cows wrote:In 2 years we'll probably have like Quad Cores, or be running several side by side processors.
Can't wait!
-
- Posts: 699
- Joined: Wed, 6. Nov 02, 20:31
back on topic, back at ubni our lecturer told us that multi-processor systems will be the enxt big improvement.
mainly due to reaching the limits of hardware, so rather than having 1 4 Ghz proc you'll start getting 1 6Ghz proc witha dual core, or maybe 2 procs.
only problem at the moment is cooling. and i believe AMD are in a betetr position than Intel due to their processors running on lower frequencies so are cooler.
mainly due to reaching the limits of hardware, so rather than having 1 4 Ghz proc you'll start getting 1 6Ghz proc witha dual core, or maybe 2 procs.
only problem at the moment is cooling. and i believe AMD are in a betetr position than Intel due to their processors running on lower frequencies so are cooler.
Flying around in my disco-mobile
[ external image ]
[ external image ]
-
- Posts: 71
- Joined: Sat, 6. Nov 04, 17:06
-
- Posts: 1409
- Joined: Tue, 3. Feb 04, 21:48
Not where software developers are concerned. There have been some articles on anandtech and Arstechnica about how annoyed most next gen console developers are that their programming load has gotten a TON more difficult with these multicored / multithreaded processors. The x86 architecture is actually very friendly for programmers, since it determines in which sequence to handle things, and has been heavily optimized for it. The cores in the X360 and PS3 don't do this, and a lot of programmers are really annoyed by it.jaguarskx wrote:The fact that the upcoming Xbox 360 and PS3 will have multi-processors will only accelerate the trend.Charlie Whiskey wrote:Yea. They have pretty much pushed the clock speed up to the limit with their current technology, so that leaves them only one option and that is to go sideways. There aren't any multi threading games out there right now but I think we'll see them show up soon.Tsar_of_Cows wrote:In 2 years we'll probably have like Quad Cores, or be running several side by side processors.
Can't wait!
Here's some good reading on that subject :
http://www.fibrousjaguar.com/thecompare.html
http://arstechnica.com/news.ars/post/20 ... 0878&73316
Now, developers eventually (hopefully) WILL switch over to using 2-6 threads per game (and I say hopefully because apparently it is VERY difficult for them to organize / sequence and optimize their code to be able to work under those conditions, and it's not guaranteed they WILL be able to figure it out), but I wouldn't say that it's going to be "speeding up" anytime soon.
Creston
-
- Posts: 41359
- Joined: Wed, 6. Nov 02, 20:31
Multi-threading IS difficult, no question about it, but if those gamer programmers can't figure it out they should be sacked and somebody competent hired in their place. Business and 3D software developers have been successfully creating multi-threaded apps for years if not decades, so it's not like this is something no-one has ever done before!Creston wrote:Now, developers eventually (hopefully) WILL switch over to using 2-6 threads per game (and I say hopefully because apparently it is VERY difficult for them to organize / sequence and optimize their code to be able to work under those conditions, and it's not guaranteed they WILL be able to figure it out), but I wouldn't say that it's going to be "speeding up" anytime soon.
-
- Posts: 2997
- Joined: Sat, 20. Mar 04, 20:50
I don't even see the problem with making things multithreaded. The only two real complications are locking resources (TBH, intelligent programming will make a request to read long before something is needed so it can be loaded in a bit of local nonshared memory ASAP and have as short a write request time). So, in one thread, say, reading inputs, you've got, "Get this value", "get this value", "get this value" wait for preparation "actually read value" ......
The "motion" thread is "request next set of inputs" "work on present data" "get next data" "request further data"
then, between the two/other cores and the shared memory, just have a simple allocation routine bit of hardware, so for example, three threads, one Hard Real Time, one Soft Real Time and one non real time, then the HRT thread gets first access, SRT gets second access, and the NRT thread gets access when neither of the other two need it. But of course, if the RT threads need something from the NRT thread, then the NRT thread needs to say "OI, URGENT" when it requests stuff too.
The only problem is testing, as more things can go wrong in more complex systems.
The "motion" thread is "request next set of inputs" "work on present data" "get next data" "request further data"
then, between the two/other cores and the shared memory, just have a simple allocation routine bit of hardware, so for example, three threads, one Hard Real Time, one Soft Real Time and one non real time, then the HRT thread gets first access, SRT gets second access, and the NRT thread gets access when neither of the other two need it. But of course, if the RT threads need something from the NRT thread, then the NRT thread needs to say "OI, URGENT" when it requests stuff too.
The only problem is testing, as more things can go wrong in more complex systems.