Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by fairlite (Novice)
on Oct 03, 2018 at 04:05 UTC ( #1223437=note: print w/replies, xml ) Need Help??


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

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.

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (11)
As of 2019-12-09 16:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?