Hi, I have an application that runs multiple Perl scripts. The number of the script as well as the content of the script are determined at run time. One can also dynamically add/delete Perl scripts at runtime. Each script is executed once in every n minutes.
My current Perl engine is built with 5.6.1 "-Duseithreads -Dusethreads". Each Perl script is hosted by one separate Perl engine on a thread. The footprint of each instance of Perl engine is about 1MB on Solaris 5.8. In order to reduce the memory footprint of the process, I was wondering if there is any way to create a pool of fixed-number Perl engines to run these scripts. That is, when it's time to execute a script, the script is assigned to one of the Perl engines from the pool. When the current interval of the script is done, the Perl engine is returned back to the pool. If possible, each script should be able to be bound to ANY Perl engine within the pool. If not, a static binding (e.g., script X is always executed by Engine #1) is ok as well. I have read perlembed, in particular, the sections "maintaining a persistent intepreter" and "maintaining multiple intepreter instances". The method described in these sections statically binds each script to one specific engine. I do have the issues of namespace and variable scoping unless I modify these Perl scripts. I was hoping there is some other workaround so that I do not need to modify any script. Also, can perl_clone() help? Any comments/hints/suggestions are welcome. Please reply by email, and I will summarize if there is sufficient interest. Thanks. Kong [EMAIL PROTECTED]
