Message queues

Raghu raghu at timbaktu.osc.edu
Sat Sep 30 02:46:44 AEST 1989


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



More information about the Comp.sys.sun mailing list