Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: (shared) memory and preloading modules using Mod-perl

by gmpassos (Priest)
on Dec 30, 2004 at 01:53 UTC ( [id://418152]=note: print w/replies, xml ) Need Help??


in reply to (shared) memory and preloading modules using Mod-perl

Take a look at Safe::World, where you can run your code inside a compartment than clean it from the memory. Also you can have many compartments as you want at the same time, each with different packages loades, or even assemble this compartments.

You also can try to make a different architecture in your application, where you can let some part of your application as a service in an unique process, so, the other process will access this service without load it, just making a call using any RPC protocol. So, take a look at SOAP.

About the prefork resource, is very nice if your OS has fork, but note that is not any module/code that can survive from a fork.

Graciliano M. P.
"Creativity is the expression of liberty".

Replies are listed 'Best First'.
Re^2: (shared) memory and preloading modules using Mod-perl
by perrin (Chancellor) on Dec 30, 2004 at 05:37 UTC
    You also can try to make a different architecture in your application, where you can let some part of your application as a service in an unique process, so, the other process will access this service without load it, just making a call using any RPC protocol. So, take a look at SOAP.

    You'd end up needing to handle concurrent requests there as well, and probably writing your own forking daemon of some kind. Not worth it, unless you can use a single-process model. About the prefork resource, is very nice if your OS has fork, but note that is not any module/code that can survive from a fork.

    The same is true of threads, i.e. don't fork or spawn a thread with an open socket or some XS data structure and then try to use it from the new process/thread.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://418152]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-19 10:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found