If perl6 has multi-threads as standard, that would be so great. I'm really amazed at how far the language has come. I've never used fork(), and even after reading documentation, I don't really understand how it works and how it's different that using system() or backticks. | [reply] |
Here are some quick answers for you. For more indepth info just do a search of this site:
- system, stripped down of security features, is simply a fork() and exec(). fork() creates a new process space which exec() populates with whatever process you specified in the shell call.
- Backticks fire off the shell call in a separate process, then captures STDOUT from it.
- Threads have far less overhead than a process and are contained within the process which allows concurrent handling of instructions.
- You may fork() and specify further perl code instead of an exec so that you end up with multiple perl interpreters running in separate process spaces.
- At any time, you can call exec() which then "overwrites" the process space with a new binary with some exceptions like file descriptors. This is useful to redirect streams before handing over the streams to some process.
AgentM Systems nor Nasca Enterprises nor
Bone::Easy nor Macperl is responsible for the
comments made by
AgentM. Remember, you can build any logical system with NOR.
| [reply] |
There is a reasonable discussion of how threading and fork
differ technically and philosophically at Threads vs Forking (Java vs Perl).
In that discussion KM came out with
Mr. Peabody
Explains fork() which is a very good starting place if you
just want to understand what fork is and why it was
invented. (In fact I recommend reading it before my link.)
| [reply] |