Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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?

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://802779]
Approved by moritz
[erix]: heh

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2018-04-25 17:18 GMT
Find Nodes?
    Voting Booth?