ForkLoop Images Assignment
Contents
Motivation
We gain experience using a parallel fork loop. Image processing often presents the opportunity for a lot of parallelism. Here we will operate on a single image, making a parallel task for each row.
Background
Revisit the Image Batch Race Condition Exercise's Background section for information on pixels and images.
Code To Investigate
Image Batch Race Condition Exercise
Image Batch Race Condition Code To Investigate
PixelFilters
PixelFilters | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
}
Code To ImplementParallelTaskPerRowImageFilter
applymethod:
To complete this method we must return a new instance of the interface HsvImage. The provided class DefaultHsvImage implements HsvImage so should serve well. Nicely, DefaultHsvImage provides both:
These two constructors match up well with the two different return types of the many incantations of join_fork_loop: where R is the return type of the TaskFunction<T, R> passed to the join_fork_loop. What should the return type from the this TaskFunction be?
Visualization
Testing Your Solution
Pledge, Acknowledgments, Citations
More info about the Honor Pledge |