Investigate use of a "writer thread" for all output #37
Labels
benchmarking
Related to benchmarking performance
enhancement
New feature or request
performance
A task related to assessing/enhancing performance
Milestone
Problem
Writing results files currently takes quite a bit of time. A writer thread would allow simulation to continue while writer threads go at their best pace writing to output.
Possible Solution
Use a writer thread and a thread-safe queue to send data to write from the main simulation thread to the writer. Possible thread-safe queue implementations are here:
Note: this should be spec'd out and benchmarked for timing before investing too much time. We also need to discuss what to do if the queue fills up from the simulation-data side before the writer can clear the data out; presumably, we would just block under that scenario.
Note: usage of the writer thread should be optional as we will want to be able to turn it on/off for debugging and benchmarking purposes.
The text was updated successfully, but these errors were encountered: