Path: utzoo!utgpu!attcan!uunet!ginosko!gem.mps.ohio-state.edu!apple!rutgers!ucsd!ucbvax!husc6!rice!sun-spots-request From: raghu@timbaktu.osc.edu (Raghu) Newsgroups: comp.sys.sun Subject: Message queues Keywords: SunOS Message-ID: <1846@brazos.Rice.edu> Date: 29 Sep 89 16:46:44 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 30 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 8, Issue 148, message 6 of 10 Two questions about message queues in SunOS: 1. I have a problem withe following piece of code. I am trying to use the message queue facility in UNIX and I have come across a strange problem. The constant KERNEL_PORT is 2401 and the getuid call returns 104 ( my uid on our SUNS at OSC). Then, with a key of 2505 the call msgget blow out with the message "Permission Denied". That should not happen as I set the msgflag to reflect that (0000600). Has anyone else seen this problem or aware of this problem... /* if ((myqid = msgget((key_t) (KERNEL_PORT + getuid()), IPC_CREAT|0000600)) */ if ((myqid = msgget((key_t) getuid(),IPC_CREAT|0000600)) == ERROR) { perror("kernel (msgget)"); exit(errno); } 2. I am exploring the use of message queues instead of the traditional socket IPC operations. The application involves a daemon-like program to rendezvous two other processes and I want to use the message queue facility to make synchronization possible. I am interesting in evaluating on how much faster it would be to go this way. Gut feeling indicates that message queues could be faster than passing UDP packets around and this might be because the UNIX kernel supports this facility better ( and probably uses it) . Any ideas or comments !! Raghu