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

Re: Using IPC::SharedMem to get nattch for a specific address?

by bliako (Vicar)
on Oct 02, 2018 at 19:56 UTC ( #1223427=note: print w/replies, xml ) Need Help??


in reply to Using IPC::SharedMem to get nattch for a specific address?

there is shared memory key and shared memory identifier. these are different as you already found out.

  • Comment on Re: Using IPC::SharedMem to get nattch for a specific address?

Replies are listed 'Best First'.
Re^2: Using IPC::SharedMem to get nattch for a specific address?
by fairlite (Novice) on Oct 03, 2018 at 04:05 UTC

    Yup. And you really do use the key for this module. The issue was the hex value. You need to either use the signed int found in /proc/sysvipc/shm, or convert the hex value you get from ipcs. I did work out the conversion from one to the other and back again, and they definitely check out as matching each other. I find it easier to just rely upon proc, although it's arguably less portable to do so.

    The shmid is actually something you get from the stat method in the module, after you've already used the key to connect to the segment.

    I'm all set, and it works like a champ. My only real complaint is that there's no (apparent) method akin to select() or inotify or the like, for when nattch changes. To do what I'm doing, I absolutely must do an expensive polling loop, unfortunately. I suspect this is not a common use case, which probably explains the absence of any such creature.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2019-11-22 15:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (113 votes). Check out past polls.

    Notices?