DescriptionI wrote up a thread pool blindly ignorant of the Skia codebase (here under threads/) and am now trying to figure out how to express it in Skia. I have some guesses but I think it'd be helpful to get early feedback:
- Instead of vector<T> I should be using SkTArray<T> or SkTDArray<T>.
- Instead of queue<T> I should be using SkLinkedList<T>.
- Where I write CondVar I suspect I want to abstract out PthreadEvent/HANDLE into a platform-dependent SkCondVar class.
- Seems like we use pthreads everywhere but Windows, which is terra incognita to me. I haven't even looked at Windows yet, but the instructions on skiadocs look doable.
- I think I want to move Runnable and ThreadPool into SkThreadUtils.
Does it seem like I'm on the right track?
I've also added in a small tweak and script I've been using to see how the pictures benchmarks varies when run with various numbers of threads.
Patch Set 1 #Patch Set 2 : forgot geomean #
Total comments: 3
MessagesTotal messages: 5
|