A message queue is a System V IPC object that allows different or unrelated processes to exchange messages. Any process can create a message queue, modify it and leave it for other processes to modify later on. Any process can immediately remove a message queue regardless of whether another process is using it. Message queues exist until they are removed or system shutdown.
The data strucuture of the message queue object is:
Both commands list all the message queue objects in use on the system:
Create message queue objects on the system:
Remove message queue objects from the system:
The data strucuture of the message queue object is:
struct msqid_ds
{
struct ipc_perm msg_perm;
msgqnum_t msg_qnum; /* no of messages on queue */
msglen_t msg_qbytes; /* bytes max on a queue */
pid_t msg_lspid; /* PID of last msgsnd(2) call */
pid_t msg_lrpid; /* PID of last msgrcv(2) call */
time_t msg_stime; /* last msgsnd(2) time */
time_t msg_rtime; /* last msgrcv(2) time */
time_t msg_ctime; /* last change time */
};
Both commands list all the message queue objects in use on the system:
cat /proc/sysvipc/msg;
ipcs -q; ipcs -q -t; ipcs -q -p; ipcs -q -c; ipcs -q -l; ipcs -q -u;
Create message queue objects on the system:
ipcmk -Q -p <permission bits>;
Remove message queue objects from the system:
ipcrm -Q <msg key>;
ipcrm -q <msg id>;
Do you have a suggestion about how to improve this blog? Let's talk about it. Contact me at David.Brenner.Jr@Gmail.com or 720-584-5229.
Comments
Post a Comment
Comments to this blog will be reviewed within 72 hours. No trolling please