Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Questions to consider:

  • Is there ever a time when its valid for one of these things to run without the other? If yes, that's an argument that they should be seperate programs, or at least the same program with command line options. If no, then it might be better to have them all fork from one process. That way if one dies, the default child and hup signal handlers will kill the others.
  • Can you gain any efficency having all the code run under one process? If each of your programs has a very high startup cost, it might be more efficent if you only have to start it once.
  • Is shared memory useful at all? Granted, you don't get real "shared memory" when you fork(), but on many operating systems, you do get copy-on-write memory, which means if you have a lot of memory that you only need to populate once and then read only, you could reduce memory usage by having just one program that does forks.
  • What is the easiest to maintain? If all you are doing is dumping three big programs into one huge program, you are going to make it harder on yourself later on. However, if this gives you opportunity to re-use code, it could be a bonus for you.

I'm sure there are more points to consider, but those are a few just off of the top of my head.


In reply to Re: To fork() or not to fork() by ehdonhon
in thread To fork() or not to fork() by asiufy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-25 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found