Author Topic: Multi-Threading  (Read 11926 times)

0 Members and 1 Guest are viewing this topic.

Offline meego

  • 24
Quote
I was only referring to mission loading, I'm well aware the overall engine update is inconceivable at this point.  SK said how much would it matter for mission loading to take advantage 'an extra core'.  I was merely stating that with 8 cores, the mission load time would drop considerably and allow the room for the enhancements Taylor mentioned to be less noticeable.

Still, that probably is too much hassle for the expected gain. Loading times aren't that bad currently. At least, that's my opinion.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Loading times aren't that bad currently

Right, again, that's why I mentioned Taylor's suggested changes to the mission loading code, which _would_ probably increase mission load times significantly.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
is it possible to lod detail boxed subobjects? personally, i would like per subobject lod-ing (with their own set of lod distance settings). i like the collision model idea. that way turret lods can be adjusted independantly of the main ship. would do wonders for the dante.

as for cores, how well is the rendering code isolated? possible to make that use a different thread?
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline colecampbell666

  • I See Dead Pictures
  • 212
  • Evolution and ascension.
So how does multi-threading work? I assume that it sends every instruction to a different core. (e.g in1c1 in2c2 in3c1)
Gettin' back to dodgin' lasers.

 
Think of a thread as a separate program coexisting within the same memory space as 1) the main process and 2) any other threads
So the instructions from one thread are actually (ignoring the operating system moving threads around cores) all being run on the one core, while instructions in another thread might all be run on another core, or time sliced by the operating system on the same core. You can even have multithreaded applications on a single core, although they may actually suffer a slight performance decrease thanks to the CPU cache being invalidated regularly
Because they're in the same space, you've gotta be careful with reading and writing memory, because you can overwrite other threads data, and there might be no way of telling whether that is the case. (The example given by (taylor?) above using the milkshop analogy is really good for seeing how this works)
This is the reason why any multithreaded application needs to be designed from the ground up to have threads, and you've gotta be awake when you're implementing them (there are some veryvery easy to make mistakes which will cause all sorts of havok)
STRONGTEA. Why can't the x86 be sane?

 

Offline colecampbell666

  • I See Dead Pictures
  • 212
  • Evolution and ascension.
OK. Thanks.
Gettin' back to dodgin' lasers.

 

Offline Spicious

  • Master Chief John-158
  • 210
Ah, the joys of things breaking due to some unrelated code in another thread.

I believe the splitting of instructions to multiple processors was sort of done with the Itanium, with pipelines rather than cores.

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Still, that probably is too much hassle for the expected gain. Loading times aren't that bad currently. At least, that's my opinion.
Making it load faster wouldn't be the point.  The point is that during model load the game can't do anything else, it just freezes.  Making it multi-threaded means that the UI would remain responsive during load and we would better be able to communicate to the user what is going on.

Remember that multi-threading isn't actually about making something faster, it's about delegating tasks so that you can do more than one thing at once.

 

Offline CaptJosh

  • 210
Thereby taking multitasking to its next logical extension.
CaptJosh

There are only 10 kinds of people in the world;
those who understand binary and those who don't.

 

Offline wijnand

  • 20
It is technically impossible to start adding "multithreading" to the Freespace 2 core, the way the code is written and also how the data is read your asking for a lot of trouble into getting it functional. There is a reason why so many companies just make new game engines from the ground up that use multithreading. The way the Freespace2 engine is written is by using a single core. Your beter of to rewrite the entire game engine from scratch then to try and figure out what is going on splitting up the functionalitity adn then making sure your not causing deadlocks because physics is waiting for the rendering to give back the information about the current models in the rendering pipe etc..










 

Offline colecampbell666

  • I See Dead Pictures
  • 212
  • Evolution and ascension.
Yeah, we figured that one out further back.

:welcome:

And why do you have that huge space below your post?
Gettin' back to dodgin' lasers.

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Oh, another new member coming straight from Game Warden. Welcome! :D
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito
My interviews: [ 1 ] - [ 2 ] - [ 3 ]

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Yeah, we figured that one out further back.

:welcome:

And why do you have that huge space below your post?

and why do you ask stupid questions?
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Fenrir

  • 28
  • ?
Why`s it so stupid? That big space could contain all sorts of mysteries...

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
It is technically impossible to start adding "multithreading" to the Freespace 2 core, the way the code is written and also how the data is read your asking for a lot of trouble into getting it functional. There is a reason why so many companies just make new game engines from the ground up that use multithreading. The way the Freespace2 engine is written is by using a single core. Your beter of to rewrite the entire game engine from scratch then to try and figure out what is going on splitting up the functionalitity adn then making sure your not causing deadlocks because physics is waiting for the rendering to give back the information about the current models in the rendering pipe etc..

Rewriting the game from scratch is not a feasible option to add multicore threading to FS2Open. It is a feasible option to write a newer, more modern game engine that would not be directly backwards compatible with FS2Open. There are just too many hacks and hardcoded ways of doing things in the FS2Open for it to ever be 100% backwards compatible. Too many missions that expect minor bugs and flaws to be present for them to even be beatable.

However that feasible option thing is only if there are coders to actually implement it.
-C