Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: basic fork question

by sickboy (Initiate)
on Jan 19, 2002 at 07:16 UTC ( [id://140038]=note: print w/replies, xml ) Need Help??


in reply to Re: basic fork question
in thread basic fork question

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re(3): basic fork question
by dmmiller2k (Chaplain) on Jan 20, 2002 at 01:35 UTC

    In you initial post, you wondered how many processes it might take to exhaust an average PC. From this I surmise you are not running under UNIX, but some form of Windows?

    If so, you may want to investigate using a threading version of Perl, and create threads rather than forking entire processes (which is a far more expensive operation on a Windows box -- even NT/2000 -- than on UNIX). With threads, you'll have to guard access to your variables, but all threads share them, so there is no need for pipes or file handles.

    I realize this post is short on details, but if your curiosity is piqued enough, you should investigate this approach further on your own. ActiveState's ActivePerl doesn't support the threading model, but if you compile Perl yourself from source, you can enable it.

    dmm

    If you GIVE a man a fish you feed him for a day
    But,
    TEACH him to fish and you feed him for a lifetime
Re: Re: Re: basic fork question
by kal (Hermit) on Jan 19, 2002 at 14:58 UTC

    You can return information to the parent via a number of methods. The common way is simply as a return code, or using pipes. Setting global variables, though, is problematic and won't allow you to scale up your solution.

    Look up IPC (inter-process communication) and decide on which method is best for your program.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-19 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found