Note that there are some explanatory texts on larger screens.

plurals
  1. POMultithreading recommendation based on program description
    primarykey
    data
    text
    <p>I would like to describe some specifics of my program and get feedback on what the best multithreading model to use would be most applicable. I've spent a lot of time now reading on ThreadPool, Threads, Producer/Consumer, etc. and have yet to come to solid conclusions.</p> <p>I have a list of files (all the same format) but with different contents. I have to perform work on each file. The work consists of reading the file, some processing that takes about 1-2 minutes of straight number crunching, and then writing large output files at the end.</p> <p>I would like the UI interface to still be responsive after I initiate the work on the specified files.</p> <p>Some questions:</p> <ol> <li>What model/mechanisms should I use? Producer/Consumer, WorkPool, etc.</li> <li>Should I use a BackgroundWorker in the UI for responsiveness or can I launch the threading from within the Form as long as I leave the UI thread alone to continue responding to user input?</li> <li>How could I take results or status of each individual work on each file and report it to the UI in a thread safe way to give user feedback as the work progresses (there can be close to 1000 files to process)</li> </ol> <p><strong>Update:</strong></p> <p>Great feedback so far, very helpful. I'm adding some more details that are asked below:</p> <ul> <li><p>Output is to multiple independent files. One set of output files per "work item" that then themselves gets read and processed by another process before the "work item" is complete</p></li> <li><p>The work items/threads do not share any resources.</p></li> <li><p>The work items are processed in part using a unmanaged static library that makes use of boost libraries.</p></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload