Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Anubis-class Cruiser (12/20/24)

Pages: 1 [2]

Author Topic: Multi-core support  (Read 8740 times)

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia
Re: Multi-core support
« Reply #15 on: March 05, 2014, 02:04:12 PM »

The only "easily" parallelizable part of Starsector is its audio engine, which may very well be in its own thread already.

That said, having multiple cores is useful because I tend to play Starsector while running a plethora of other pieces of software, which get to use their own threads.
Logged

Dr.Noid

  • Lieutenant
  • **
  • Posts: 79
    • View Profile
Re: Multi-core support
« Reply #16 on: March 06, 2014, 07:48:38 AM »

Another one might be the in-system simulations, since what happens in one system doesn't have a direct influence on what happens in another system. A fleet going from a system to hyperspace or vice-versa would influence both threads, but it doesn't matter if that transition takes a simulation tick.
Depending on how heavy those simulations are and how many systems need to be simulated you could have a thread per system, a thread per x systems, or a ThreadPool or ExecutorService with each system being a task that gets scheduled in that pool.

Any way, if you want to dip your toes in the ThreadPool, I can recommend reading the java tutorial on concurrency
Logged

Midnight Kitsune

  • Admiral
  • *****
  • Posts: 2856
  • Your Friendly Forum Friend
    • View Profile
Re: Multi-core support
« Reply #17 on: March 09, 2014, 01:57:08 AM »

OK, as someone that doesn't have a very good grasp on this kind of stuff, I would like to ask this: Would it be better to set the affinity (the option in Task Manager) to only my second core? Because I notice that in the performance tab, my first core's "usage graph" is noticeably higher and since this game DOESN'T have muti core support, wouldn't that give the game more CPU power to use?
Logged
Help out MesoTroniK, a modder in need

2021 is 2020 won
2022 is 2020 too

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: Multi-core support
« Reply #18 on: March 09, 2014, 03:51:30 AM »

In short, no.

In long, windows is supposed to optimise which core handles which threads. If for someone reason Windows is acting funky (rare) you may need to. You also have to take into account hyper-threading and turbo-boost technologies that may be on your Intel chip.

If you've got turbo-boost, keeping more things on the one thread will cause that particular core to ramp up it's frequency in which case although the core has a higher utilisation it also has a dynamically higher frequency with something like a 1/3 additional processing power (it varies from model to model).

If you've actually got a single core CPU with hyperthreading, don't worry about it, affinity isn't going to do a thing. Hyperthreading is...kind of like a smart cache...sort of..to make context switches between threads less expensive.
Logged

Midnight Kitsune

  • Admiral
  • *****
  • Posts: 2856
  • Your Friendly Forum Friend
    • View Profile
Re: Multi-core support
« Reply #19 on: March 09, 2014, 06:14:22 AM »

In short, no.

In long, windows is supposed to optimise which core handles which threads. If for someone reason Windows is acting funky (rare) you may need to. You also have to take into account hyper-threading and turbo-boost technologies that may be on your Intel chip.

If you've got turbo-boost, keeping more things on the one thread will cause that particular core to ramp up it's frequency in which case although the core has a higher utilisation it also has a dynamically higher frequency with something like a 1/3 additional processing power (it varies from model to model).

If you've actually got a single core CPU with hyperthreading, don't worry about it, affinity isn't going to do a thing. Hyperthreading is...kind of like a smart cache...sort of..to make context switches between threads less expensive.
Ah, ok. Thanks!
Logged
Help out MesoTroniK, a modder in need

2021 is 2020 won
2022 is 2020 too
Pages: 1 [2]