Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

I have a programm that process files one by one,now i want to change it into a multithreaded programm so it will process more files in the same time.

it will be a gui program,so the main process will control the gui , buttons and the log window.

thoughts & problems
1. all files that are in procces right now , stored in 1 array.
2. avoid sametime acces of that array,log is no problem because of system and perl buffering on outputs.
3. several exit modes: stop,abort , exit , immediate exit.
stop = stop processing of new files but finish all in progress files
abort = same as stop but interrupt in progress files and roll back all changes and move in progress files back to need_to_process
exit = same like stop but quit the program
immediate exit = same like abort but quit program

4. logging, star and end of processing shoud be written to logfile,and problems and oks also.
there will be and log parser that checks if every file has a start and end in log if not delete file changes from db and move problem file back to need_to_process.
only will be uses on first start of program or manually after critical aborts(system off, or something else)

5. the logwindow shoud scroll down so it always show the latest infos.
6. the programm will run forever. so it need to be coded nicly in var handling
7. if they are no files to process the programm will wait 5 mins and then look again for files.
8. maximum threads shoud be 6 including main thread so 5 workers.

 

thats what is in my mind so far, any suggestions or points that i shoud think about or to avoid ?

kd

ultibuzz


In reply to convert a single thread application to multithread with GUI by ultibuzz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (10)
    As of 2014-08-22 21:00 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (165 votes), past polls