I'm using CGI::Application and CGI::Application::Plugin::Session

In runmode A, the user select two or more from a list of files pdf to merge together. This is a simple form with checkboxes.

This directs to runmode B, in which the operation takes place, any errors are recorded as feedback in the session object. Runmode B gives no output to the user, simply runs the operation, records any errors in the session, and redirects back to the list. (At most any given runmode, the session is checked for "feedback" and it is output to the user one time, and then erased. This has come in incredibly handy. CGI::Application::Plugin::Feedback)

The users say this takes a long time to do- waiting for the operation to actually take place. It's not going to take less time, because it's an expensive operation.

What I have in mind as a solution is; they select from a list of files, and I fork mid runmode. While forked, the operation takes place, and if errors happen, they are saved to the session object.

My concern is that two instances will potentially be writing to the session object at the same time. Are there any other concerns that I should have (not about fork) in regards to what I am going to do here?


In reply to cgi forking, parent and child both writing to CGI::Session by leocharre

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.