Week 2 Report: June 5th to June 11th
-
Spent more time looking at the task pool utilities inside Blender: task_pool.cc
-
Discussed the next steps I put down the previous week with @iss. Agreed it would make more sense to use a task pool instead of dispatching many jobs.
-
Read through some more examples of TaskPool in Blender’s code base. In particular these were useful:
-
Tested my task pool implementation to compare the speed between multi-threaded and single-threaded processing. Demo videos below (NOTE: both videos were recorded in debug mode):
-
PR is up: #108877 - VSE: Process audio strips waveforms in parallel - blender - Blender Projects
Notes
I spent a lot of time debugging a use-after free problem with my TaskPool implementation. I didn’t realize that BLI_freelinkN would deallocate the preview job data and sometimes the threads would start executing after the data was freed. That cause a memory access violation error.
Thankfully the allocator marked the deallocated pointer location with 0xDDDDDDDDDDDDDDDD. Took a while but when I finally noticed that it was an easy fix.
Next steps
- Go through the PR review and get it merged.
- Measure the speed improvements in Release mode.
- Update report with speed improvement data.