Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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
Replies are listed 'Best First'.
Re: cgi forking, parent and child both writing to CGI::Session
by Anonymous Monk on Oct 23, 2009 at 00:39 UTC

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2015-11-30 02:04 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (756 votes), past polls