Started by jamespetts, March 24, 2012, 12:16:18 AM
0 Members and 1 Guest are viewing this topic.
Quote from: jamespetts on March 24, 2012, 11:08:27 AMThe problem is that we need to find not just the answer to the binary question of whether a city is connected at all, but the quantitative answer as to what the quality of the connexion is. A connexion by a meandering dirt track should attract far less traffic than a connexion by a motorway.
parallelfor(i=0; i<10; i++) array[i]++; // OK
parallelfor(i=1; i<10; i++) array[i] += array[i-1]; // bad!
QuoteIn order to use it safely, you must not write code which touches the data other iteration steps are using
Quote from: kierongreen on March 25, 2012, 09:16:44 AMAnd simtrans does this, many times, in many places. Short of a complete code rewrite there's not a lot that can be done about this. So while a pathfinding routine might be safe to run in parallel threads on it's own, it is not with the rest of the simutrans code.
A ---------+----------- B | | C
Quote from: jamespetts on March 25, 2012, 07:30:31 PMIsidoro - it was for this reason that I proposed using the server to push the results to the clients rather than simultaneously calculating the results on server and client (as is done for everything else in Simutrans). Would this not suffice to solve the problem?