View Issue Details

IDProjectCategoryView StatusLast Update
0004695Spring engineGeneralpublic2017-09-24 19:14
Reportermsafwan Assigned Toabma  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Product Version98.0 
Summary0004695: Please replace spin-lock, its very bad
DescriptionOkay I'm sorry about that last bug report. Sorry jK

Okay, I read the link, it says spin-lock "burn system resource and make CPU unavailable for system task" unless.. you added "sleep", or replace it with "blocking". This clearly state spin-lock its bad because Spring did waste resources badly like I mentioned in previous bug report.

Player also said "WorkerThreadSpinTime=0" fix stutter, this further says spin-lock is bad, it create stutter rather than make Spring faster.

IMO spin-lock need to be fixed to be more efficient or replaced with something more efficient, like what the link says.
Steps To ReproduceLook at what people say, sometimes they mention about possible overheat, sometimes they said game became unplayable laggy after being in game too long.
Additional Informationabma ask when it started:
It started probably since Spring 96.

abma asked what's my settings:
Here is my settings recorded in this infolog: http://pastebin.com/0xjTwL9R

abma's links on spin-lock:
https://springrts.com/mantis/view.php?id=4693#c14115
TagsNo tags attached.
Checked infolog.txt for Errors

Activities

cleanrock

2015-03-09 09:58

reporter   ~0014124

GoogleFrog have changed default WorkerThreadSpinTime value a few times in ZKL, it is probably easier to convince him to set it to zero as default ZKL settings.

Anarchid

2015-03-09 13:13

reporter   ~0014126

I'll set WTST=0 as default in ZKL and inflict it on the masses with a widget somewhere during next week hopefully.

However, even with WTST=0 i get weird behaviour (98.0.1-398 and later) where everything starts flickering as soon as i time out or when catching up.

With nonzero WTST i get this even in realtime.

abma

2015-03-09 23:58

administrator   ~0014135

@Anarchid:

search for wrong opengl calls / DebugGL=1 / fix these errors

abma

2015-03-09 23:59

administrator   ~0014136

Last edited: 2015-03-10 00:01

also as note: WorkerThreadSpinTime = 1 is default where ZK seems to default to 5 which increases cpu load (but maybe performance, too)

msafwan

2015-03-10 01:21

reporter   ~0014137

Last edited: 2015-03-10 01:30

what does using Spin-lock achieve?

I'm just saying it put lots of stress on my CPU. Fan always at max when Spring running. I don't really want to risk my PC, I don't have enough resource to replace it. Limit my CPU usage could be solution, but think about it... what about other people?

abma

2015-03-10 01:31

administrator   ~0014138

Last edited: 2015-03-10 01:32

the reason is written there: https://stackoverflow.com/questions/1107593/what-are-trade-offs-for-busy-wait-vs-sleep

"lock" is used for syncing threads.

msafwan

2015-03-10 01:47

reporter   ~0014139

Is people don't believe me about the heat issue? or just can't/won't fix at the moment?

abma

2015-03-10 01:53

administrator   ~0014140

> Is people don't believe me about the heat issue?

its not that devs are waiting for bug reports. they do what they think is most important and most fun. my personal todo list for spring is way to long, realistic seen i never can do/fix all whats on it.

> or just can't/won't fix at the moment?

its argueable if this is a bug of spring or not. its more a problem that your system can't run at 100% load for a long time, the cooling is to weak. imo basicly the system is broken.

imo it only matters what is faster, busy waiting or sleep (and busy waiting seems to be the winner)

msafwan

2015-03-10 04:36

reporter   ~0014141

Last edited: 2015-03-10 04:56

okay, I Google-d (on spin-locks). It must be a bug...

Dev-Spring had big CPU overhead and minimal speed gain. (the cost/gain ratio make less sense for my system)

And,
since spin-lock is best when task is closed together, could it be you guys made a mistake and spin-locked between empty game-frame? also why spin-lock when we set to 1 core?

abma

2015-03-10 10:10

administrator   ~0014142

Last edited: 2015-03-10 10:12

Quote from your infolog.txt:

> VSync disabled

enable vsync and if it still still stays at >= 100% cpu and below 60 fps your cpu is to slow.

Issue History

Date Modified Username Field Change
2015-03-08 15:30 msafwan New Issue
2015-03-08 15:32 msafwan Tag Attached: free
2015-03-08 15:32 msafwan Tag Attached: hardware stressor
2015-03-08 15:33 msafwan Tag Detached: free
2015-03-09 09:58 cleanrock Note Added: 0014124
2015-03-09 13:13 Anarchid Note Added: 0014126
2015-03-09 23:58 abma Note Added: 0014135
2015-03-09 23:59 abma Note Added: 0014136
2015-03-10 00:00 abma Note Edited: 0014136
2015-03-10 00:01 abma Note Edited: 0014136
2015-03-10 01:21 msafwan Note Added: 0014137
2015-03-10 01:28 msafwan Note Edited: 0014137
2015-03-10 01:30 msafwan Note Edited: 0014137
2015-03-10 01:30 msafwan Note Edited: 0014137
2015-03-10 01:31 abma Note Added: 0014138
2015-03-10 01:32 abma Note Edited: 0014138
2015-03-10 01:47 msafwan Note Added: 0014139
2015-03-10 01:53 abma Note Added: 0014140
2015-03-10 04:36 msafwan Note Added: 0014141
2015-03-10 04:38 msafwan Note Edited: 0014141
2015-03-10 04:39 msafwan Note Edited: 0014141
2015-03-10 04:42 msafwan Note Edited: 0014141
2015-03-10 04:43 msafwan Note Edited: 0014141
2015-03-10 04:44 msafwan Note Edited: 0014141
2015-03-10 04:44 msafwan Note Edited: 0014141
2015-03-10 04:45 msafwan Note Edited: 0014141
2015-03-10 04:46 msafwan Note Edited: 0014141
2015-03-10 04:46 msafwan Note Edited: 0014141
2015-03-10 04:47 msafwan Note Edited: 0014141
2015-03-10 04:48 msafwan Note Edited: 0014141
2015-03-10 04:51 msafwan Note Edited: 0014141
2015-03-10 04:53 msafwan Note Edited: 0014141
2015-03-10 04:55 msafwan Note Edited: 0014141
2015-03-10 04:56 msafwan Note Edited: 0014141
2015-03-10 10:10 abma Note Added: 0014142
2015-03-10 10:10 abma Status new => closed
2015-03-10 10:10 abma Assigned To => abma
2015-03-10 10:10 abma Resolution open => no change required
2015-03-10 10:12 abma Note Edited: 0014142
2017-09-24 19:14 Kloot Tag Detached: hardware stressor