Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Looking for alternative for IPC::Shareable (or increase size)

by NERDVANA (Deacon)
on Aug 06, 2020 at 02:08 UTC ( [id://11120389]=note: print w/replies, xml ) Need Help??


in reply to Looking for alternative for IPC::Shareable (or increase size)

You say that you are copying the data out before processing it.... This sounds to me like what you really want is a pipe. The only reason to share memory between two processes is if you need to perform random access or use it more than once. If the data is large, you will also save memory by transferring it over a pipe rather than allocating megabytes of shared memory just to use as a temporary storage area.

Perhaps the problem you were solving was that with shared mem you will never get deadlocked waiting on the other process to finish writing the data? For that, there are event libraries that run a callback when data is available on a pipe, and you can use that to keep the data moving in the background and then fire off a callback of your own when it is done.

  • Comment on Re: Looking for alternative for IPC::Shareable (or increase size)

Replies are listed 'Best First'.
Re^2: Looking for alternative for IPC::Shareable (or increase size)
by DomX (Novice) on Aug 06, 2020 at 07:21 UTC
    Dear NERDVANA,

    No, I actually need to be able to access this array from (sometimes many) different children. Pipes are insufficient, also because of IPC::Shareables lock mechanism of course I never needed to think more about being deadlocked... ^^'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-20 01:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found