Commit Graph

21 Commits

Author SHA1 Message Date
Jonathan G Rennison
2080daab8d Linkgraph: Refactoring to avoid manual deletes. 2017-02-08 21:59:41 +00:00
Jonathan G Rennison
375dbdbfe1 Linkgraph: Allow job threads to be aborted early when clearing schedule. 2016-11-26 00:33:50 +00:00
Jonathan G Rennison
d08d1cbd67 Linkgraph: Avoid attempting to merge/apply job when cleaning schedule.
This can cause crashes when switching savegame.
Move job merge/apply out of destructor into separate function.
2016-11-26 00:15:01 +00:00
Jonathan G Rennison
1cede8431f Linkgraph: Support running multiple jobs per spawned thread. 2016-11-01 23:02:15 +00:00
Jonathan G Rennison
84e61b690a Linkgraph: Changes to job scheduling algorithm.
This is to improve responsiveness of link graph updates, whilst
avoiding being blocked waiting for updates to complete.
Previously, large numbers of cheap jobs resulted in poor responsiveness
as it took a long time for jobs to cycle round.

Add 'linkgraph' debug category.
2016-11-01 23:02:15 +00:00
Jonathan G Rennison
b8a89437a1 Enable use of atomic store/load on clang. 2016-09-08 18:40:08 +01:00
Jonathan G Rennison
61ff4f5d97 Limit linkgraph recalc interval to minimum of 2 ticks.
The interval could otherwise fall to 1 tick at very high day lengths,
and low number of days interval, with recalc not scaled by day length
enabled.
2016-01-31 12:22:03 +00:00
Jonathan G Rennison
78cf5ca682 Add setting for linkgraph times to be in non daylength scaled days.
Savegame format change for link graph jobs.
Change link graph scheduler to support more than one operation
per day, on _date_fract ticks other than SPAWN_JOIN_TICK.
2016-01-29 00:26:47 +00:00
Jonathan G Rennison
3896952136 Join more than one link graph job at once where possible.
This can occur when the link graph recalculation times are changed.
In particular, if the duration or interval are reduced, the new jobs
will be delayed until the completion of the previous long job,
and then remain backlogged thereafter as jobs are dequeued at the same
rate as they are queued.
2016-01-28 19:32:21 +00:00
Jonathan G Rennison
548ea31e83 Fix compilation on gcc before 4.7 due to use of atomic builtins. 2016-01-07 22:45:11 +00:00
Jonathan G Rennison
c6854afcef Pause the game instead of blocking when link graph jobs lag.
Check if the job is still running one date fract tick before it
is due to join and if so pause the game until its done.
This avoids the main thread being blocked on a thread join.
Show if pause is due to link graph job in status bar, update network
messages.
This does not apply for network clients.
2015-09-03 18:36:30 +01:00
frosch
a14b836bf2 (svn r27178) -Fix [FS#5969]: Data race due to lazy initialisation of objects. 2015-03-07 18:27:01 +00:00
rubidium
2be4215f43 (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
fonsinchen
ebcba0c0e3 (svn r26347) -Fix [FS#5898]: Make sure link graph jobs can delete themselves after SLA_NULL. 2014-02-16 18:42:59 +00:00
fonsinchen
cd68a2d8a5 (svn r26276) -Fix [FS#5874]: Don't spawn link graph jobs for link graphs with only one node 2014-01-24 21:39:07 +00:00
fonsinchen
fea3a433b2 (svn r26166) -Fix: Scale flows only after mapping to avoid rounding errors. 2013-12-20 14:57:44 +00:00
fonsinchen
75cff48a5d (svn r25867) -Fix [FS#5764]: Shift dates on link graphs when using scenario editor date tool. 2013-10-15 17:32:31 +00:00
fonsinchen
94baba190e (svn r25357) -Add: flow mapper for link graph 2013-06-09 13:01:23 +00:00
fonsinchen
1cc410f7bb (svn r25356) -Add: Multi-Commodity-Flow solver for link graph 2013-06-09 13:00:41 +00:00
fonsinchen
aa393a8ee9 (svn r25355) -Add: demand handler for link graph 2013-06-09 12:59:51 +00:00
fonsinchen
97a9908b0e (svn r25354) -Add: link graph schedule and typedefs for LinkGraph and related classes 2013-06-09 12:58:37 +00:00