Hi all,
I currently have the following workflow in place :
- server listening on a TCP port awaiting for connections
- a payload is sent to the server
- I fork through fork() and launch the treatment of the child
- the child exit(0)
The problem I'm facing is that the child, following the inner working of fork, gets the memory copied from the parent, and the subsequent perl modules initialy loaded by the server.
However said modules can be updated from time to time, but the loaded copy of the modules are not refreshed so the child always ends up with the older modules even though the modules have been updated on disk.
I understand that this behaviour is standard and expected but it doesn't suits my needs, so I'm seeking some information or pointers on the best way to achieve the following :
- i want to keep the server listening behaviour, which is just a lightweight process listening and sending payload to be worked on
- i don't need to handle the child return in the server (parent), i can keep track of it through another way if needed
- i absolutely need to make sure that the child doing the work has the last version of the modules loaded, the existing child running can work on the last copy until they die off
I tried to use Module::Reload but given the complexity of modules being loaded I always ended up generating infinite loops and i'm sure i need that.
It seems that using pipes might help, but not quite sure about that or how to implement it.
Thanks for your help and tips on the best way to achieve that.
Best,
M
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.