Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Can forks share data more easily?

by A_Banknote (Initiate)
on Sep 18, 2004 at 11:19 UTC ( #391976=perlquestion: print w/replies, xml ) Need Help??

A_Banknote has asked for the wisdom of the Perl Monks concerning the following question:

It's gonna make me carzy to trouble with the defferent sessions' data share.
Is there a easy way to do this? Needn't UNIX sock, needn't any pipes, even needn't to open a file. My only desire is to share a variable between 2 sessions, why is so hard to share do so?
Any solution but thread(which is much sick than fork)?
Thx a ton

Replies are listed 'Best First'.
Re: Can forks share data easilier?
by borisz (Canon) on Sep 18, 2004 at 11:40 UTC
    No, you must access/lock the data from the other process. This can be done with sockets, pipes, files, databases and more. There are several modules that help, look here: IPC modules.
Re: Can forks share data easilier?
by Zaxo (Archbishop) on Sep 18, 2004 at 17:58 UTC

    SysV IPC's shared memory will do what you want, but you need to run on a kernel that supports it. I haven't used that much, disliking SysV IPC in general, but IPC::ShareLite's readme looks promising.

    After Compline,

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://391976]
Approved by graff
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2020-11-24 18:25 GMT
Find Nodes?
    Voting Booth?

    No recent polls found