Dual Core

Anything not relating to the X-Universe games (general tech talk, other games...) belongs here. Please read the rules before posting.

Moderator: Moderators for English X Forum

karleccleson
Posts: 62
Joined: Wed, 6. Nov 02, 20:31
xr

Dual Core

Post by karleccleson » Thu, 30. Jun 05, 11:32

Any thoughts on coding for Dual Core CPUs
One for the economy and general mission stuff and one for player and local flight stuff?

Maybe not for X3 as DC CPU's are very new and very expensive, but maybe a patch or in X4?????

The_Abyss
Posts: 14933
Joined: Tue, 12. Nov 02, 00:26
x3

Post by The_Abyss » Thu, 30. Jun 05, 11:48

Maybe for the future, yes. It has been (very casually...) discussed.
Strung out on Britain's high, hitting an all time low

Sabo
Posts: 167
Joined: Sat, 27. Dec 03, 02:26
x2

Post by Sabo » Thu, 30. Jun 05, 14: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.

User avatar
soimafreak
Posts: 699
Joined: Wed, 6. Nov 02, 20:31
x2

Post by soimafreak » Thu, 30. Jun 05, 14:53

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.
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.
Flying around in my disco-mobile
[ external image ]

pjknibbs
Posts: 41359
Joined: Wed, 6. Nov 02, 20:31
x4

Post by pjknibbs » Thu, 30. Jun 05, 17:33

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.
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!

Galaxy613
Posts: 3285
Joined: Tue, 28. Dec 04, 02:19
x4

Post by Galaxy613 » Thu, 30. Jun 05, 18:44

...and thats why we sit back and wait for Dual Cores to become pratical! :lol:
10,000 Lightyears of awesomeness

xeon_1
Posts: 3535
Joined: Thu, 4. Dec 03, 17:16
x4

Post by xeon_1 » Thu, 30. Jun 05, 18:57

...and thats why we sit back and wait for Dual Cores to become pratical!
and affordable to normal people :evil:

JihadJoe
Posts: 71
Joined: Sat, 6. Nov 04, 17:06

Post by JihadJoe » Thu, 30. Jun 05, 19:30

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.......

Jon Tetrino
Posts: 3276
Joined: Mon, 2. Aug 04, 22:27
x4

Post by Jon Tetrino » Thu, 30. Jun 05, 20:22

anyone forgetting the CELL

iirc thats dual core.

User avatar
Tsar_of_Cows
Posts: 9966
Joined: Sat, 31. Jan 04, 14:38
x4

Post by Tsar_of_Cows » Thu, 30. Jun 05, 20:27

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.......
Easily.

In 2 years we'll probably have like Quad Cores, or be running several side by side processors.

Can't wait! :D

User avatar
soimafreak
Posts: 699
Joined: Wed, 6. Nov 02, 20:31
x2

Post by soimafreak » Thu, 30. Jun 05, 20:45

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 :S
Flying around in my disco-mobile
[ external image ]

User avatar
Charlie Whiskey
Posts: 1728
Joined: Thu, 11. Mar 04, 10:37
x3tc

Post by Charlie Whiskey » Thu, 30. Jun 05, 21:08

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! :D
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.
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?
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! :wink:

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)

slick_rick70uk
Posts: 245
Joined: Sun, 1. Aug 04, 05:52
x3tc

Post by slick_rick70uk » Thu, 30. Jun 05, 21:22

Just wonder how powerfull quantum computers are gonna be, then think of the powerfull and good the games will be. Might be a nightmare for programers though.
[ external image ]

When the going gets tough the tough get naked

User avatar
soimafreak
Posts: 699
Joined: Wed, 6. Nov 02, 20:31
x2

Post by soimafreak » Thu, 30. Jun 05, 21:27

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 ;)
Flying around in my disco-mobile
[ external image ]

jaguarskx
Posts: 1520
Joined: Thu, 21. Oct 04, 15:14
x3

Post by jaguarskx » Fri, 1. Jul 05, 03:58

Charlie Whiskey wrote:
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! :D
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.
The fact that the upcoming Xbox 360 and PS3 will have multi-processors will only accelerate the trend.

User avatar
soimafreak
Posts: 699
Joined: Wed, 6. Nov 02, 20:31
x2

Post by soimafreak » Fri, 1. Jul 05, 11:48

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.
Flying around in my disco-mobile
[ external image ]

JihadJoe
Posts: 71
Joined: Sat, 6. Nov 04, 17:06

Post by JihadJoe » Fri, 1. Jul 05, 13:25

yes....but daul cores of intel can be stable too...(altho I am an AMD fanboy).
and plus,you get a RELLY hot in-house heating system,AT NO EXTRA COST :lol:

Creston
Posts: 1409
Joined: Tue, 3. Feb 04, 21:48
x3tc

Post by Creston » Fri, 1. Jul 05, 15:31

jaguarskx wrote:
Charlie Whiskey wrote:
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! :D
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.
The fact that the upcoming Xbox 360 and PS3 will have multi-processors will only accelerate the trend.
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.

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

pjknibbs
Posts: 41359
Joined: Wed, 6. Nov 02, 20:31
x4

Post by pjknibbs » Fri, 1. Jul 05, 18:03

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.
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!

User avatar
Some Strange Man
Posts: 2997
Joined: Sat, 20. Mar 04, 20:50
x3

Post by Some Strange Man » Fri, 1. Jul 05, 19:19

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.

Return to “Off Topic English”