Quantcast
Channel: Parallel Computing in C++ and Native Code forum
Viewing all articles
Browse latest Browse all 856

Which parallel pattern should I use?

$
0
0

I have an application where I would like to use modern parallel programming. I have a specific case in mind and I currently handle it by creating separate threads. I will explain it at a high level and I am interested in hearing suggestions for which approach I should take (eg tasks, parallel loop, etc).

Here is a description of the problem in generic terms.  It is not exactly what I am doing but it is similar enough so that you can understand:

My application is Win32 dialog with a tree control that allows selecting different directories on the hard drive.  It searches for files of a certain type that contain images in a proprietary file format.  Each image file is then loaded and rendered as a thumbnail in my dialog.  It is basically an image browser.  There may be 100s of these images in a directory so they must be rendered in a separate thread to prevent locking up the application.  And, the user should be able to change the directory while they are being rendered.  So, obviously, there must be a way to cancel the operation.

It is obvious to me that I must have some routine that can be started and possibly canceled.  I would like to be able to take advantage of multiple CPU cores while rendering the files since they are all independent.  Is this a classic case of using tasks, task groups, parallel for loop?  I'm curious to see how others would tackle this.

Thanks!


The Hinged Newt


Viewing all articles
Browse latest Browse all 856

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>