Closed yakra closed 4 years ago
- Try removing
log_mtx
, replace<<
with+
operators, and see how that works out.
concurrencies.log gets mangled. Not as atomic as I thought.
- If that's not satisfactory, build a list of strings in each thread, splicing onto a list in the main thread when done, and finally output the file at once all threads finish.
Or rather, just keep an array of lists, then step through it & write each one. But anyway.
This is a big help immediately. One thread is a bit slower now, due to constructing the list of strings rather than writing the log file directly. I could make up for this by interleaving some if (args.numthreads == 1)
& else
with the #ifdef
s and using the same code for 1 thread as when threading is disabled, but don't really care; If running single-threaded for anything other than speed testing or debugging, one should disable threading at the preprocessor level anyway.
- Try
if (hs !=s)
(This may also help the Python version) https://github.com/yakra/DataProcessing/blob/68315717a3802d7ab37a4c86496eae89826f042e/siteupdate/cplusplus/threads/ConcAugThread.cpp#L18-L19
Nope, not even attempted. Travelers would never get credited for non-concurrent segments.
log_mtx
, replace<<
with+
operators, and see how that works out.if (hs !=s)
(This may also help the Python version) https://github.com/yakra/DataProcessing/blob/68315717a3802d7ab37a4c86496eae89826f042e/siteupdate/cplusplus/threads/ConcAugThread.cpp#L18-L19clin_mtx
? All these operations are packed into a much smaller timeframe...Similar: https://github.com/TravelMapping/DataProcessing/issues/281