Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

cgi forking, parent and child both writing to CGI::Session

by leocharre (Priest)
on Oct 22, 2009 at 18:35 UTC ( #802779=perlquestion: print w/ replies, xml ) Need Help??
leocharre has asked for the wisdom of the Perl Monks concerning the following question:

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?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://802779]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-10-24 23:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (138 votes), past polls