unix - IPCS message passing related queries -


i dealing message passing ipcs method. have few question regarding this:

  1. key field in ipcs -q shows me 0x00000000 means ?
  2. can see messsage passes using msqid ?
  3. if 2 entries present (for particular user) after executing command ipcs -q. means 2 messages passed particular user ?
  4. if used-bytes , message fields set 0 mean?
  5. is there away see if message queue full or not?
  6. how many queues can have 1 particular user?

i tried goggling, not able find answer these questions. please

1. "key" field of shared memory segments 0x00000000. indicates ipc_private key specified during creation of shared memory segment. manual of shmget() contains more details.

2. afaik, cannot done. if msg "de-queued" msgq, intended receiver not see it.

3. 2 entries in list of message queues indicates there 2 active message queues on system identified corresponding unique keys.

creating additional msgq : ipcmk -q
deleting existing msgq : ipcrm -q <unique-key>

4. used-bytes , messages fields set 0 indicate no transfers have occurred using particular msgq.

5. 1 way obtain number of msgs queued-up in msgq programmatically shown in following c snippet. next can compared size of msgq demonstrated in answer.

int ret = msgctl(msqid, ipc_stat, &buf);   uint msg = (uint)(buf.msg_qnum);   printf("msgs in q = %u\n", msg);   

6. there exists limit on total memory used msgqs on system combined together. can obtained ulimit -q. amount of bytes used in msgq listed under used-bytes column in output of ipcs -q. total number of msgqs limited amount of memory available create new msgq msgq memory pool limit seen above.

also checkout latter part of answer few sample operations on posix message queues.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -