public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Benedyczak <golbi@mat.uni.torun.pl>
To: bert hubert <ahu@ds9a.nl>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, wrona@mat.uni.torun.pl
Subject: Re: posix message queues, was Re: 2.6.4-rc1-mm1
Date: Mon, 01 Mar 2004 15:27:30 +0100	[thread overview]
Message-ID: <40434852.1000102@mat.uni.torun.pl> (raw)
In-Reply-To: <20040301112631.GA28526@outpost.ds9a.nl>

bert hubert wrote:

>On Sun, Feb 29, 2004 at 02:06:17PM -0800, Andrew Morton wrote:
>
>  
>
>>- Added the POSIX message queue implementation.  We're still stitching
>>  together a decent description of all of this.  Reference information is at
>>	http://www.mat.uni.torun.pl/~wrona/posix_ipc/
>> and
>>	http://www.opengroup.org/onlinepubs/007904975/basedefs/mqueue.h.html
>>    
>>
>
>I can confirm that basic functionality is there. Both blocking and
>nonblocking operations work as advertised. Queue properly blocks when full
>or empty.
>
>mq_timedsend does not wait, it immediately returns ETIMEOUT with the queue
>is full:
>
>         struct timespec ts;
>         ts.tv_sec=1;
>    	 ts.tv_nsec=0;
>         sprintf(msgptr,"%05d %s",c,stime);
>	 
>         if ( mq_timedsend(mqd,msgptr,msglen,msg_prio, &ts) )
>	 {
>	    perror("mq_send()");
>	      break;
>	 }
>
>results in:
>
>$ ./mqreceive /Q32x128
>1: priority 0  len 64 text 00001 Mon Mar  1 12:20:11 2004  
>$ ./mqreceive /Q32x128
>1: priority 0  len 64 text 00001 Mon Mar  1 12:20:11 2004  
>$ ./mqsend  /Q32x128
>$ ./mqsend  /Q32x128
>$ ./mqsend  /Q32x128
>mq_send(): Connection timed out  <- immediately
>  
>
It _should_ return immediately. mq_timedsend timeout must be given as 
absolute value, so if you want to have one second timeout from now,
you must do:

	ts.tv_sec = time(NULL) + 1;
    	ts.tv_nsec = 0;

And I don't have idea why POSIX defines timeout as absolute not relative 
;-).

>I would very much advise Michal and Krzysztof to add some basic examples to
>their page. I had to scour the internet to find some working code.
>  
>
Thats right. The above problem also shows that such examples can be 
usefull. We are just now updating man pages for the library (there are 
some obsolete informations) and I will prepare some well commented programs.

>Mounting the queuefs works but the fs, confusingly, is called mqueue and not
>mqueuefs.
>  
>
As proc or msdos. Of course it can be changed if more people will want 
'fs' suffix. Menuconfig help gives proper name.

Regards,
Krzysiek


  reply	other threads:[~2004-03-01 14:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-29 22:06 2.6.4-rc1-mm1 Andrew Morton
2004-02-29 22:24 ` 2.6.4-rc1-mm1 Christoph Hellwig
2004-02-29 22:31   ` 2.6.4-rc1-mm1 Andrew Morton
2004-03-02 13:52   ` 2.6.4-rc1-mm1 bill davidsen
2004-03-01  1:02 ` 2.6.4-rc1-mm1 Nick Piggin
2004-03-01  1:14   ` 2.6.4-rc1-mm1 Andrew Morton
2004-03-01  1:30     ` 2.6.4-rc1-mm1 Nick Piggin
2004-03-01  1:45       ` 2.6.4-rc1-mm1 Nick Piggin
2004-03-01  2:05       ` 2.6.4-rc1-mm1 Andrew Morton
2004-03-01  1:10 ` 2.6.4-rc1-mm1: multiple definitions of `debug' Adrian Bunk
2004-03-01  1:41   ` Andrew Morton
2004-03-01 17:49   ` Torrey Hoffman
2004-03-01  1:39 ` 2.6.4-rc1-mm1 Marc-Christian Petersen
2004-03-01  1:46   ` 2.6.4-rc1-mm1 Marc-Christian Petersen
2004-03-01 11:26 ` posix message queues, was 2.6.4-rc1-mm1 bert hubert
2004-03-01 14:27   ` Krzysztof Benedyczak [this message]
2004-03-01 16:41 ` 2.6.4-rc1-mm1 Prakash K. Cheemplavam
2004-03-02 13:38   ` 2.6.4-rc1-mm1 Prakash K. Cheemplavam
2004-03-02 20:45     ` 2.6.4-rc1-mm1, as scheduler causes higher idle temp? Prakash K. Cheemplavam
2004-03-02 21:11       ` Andrew Morton
2004-03-02 21:39         ` Prakash K. Cheemplavam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40434852.1000102@mat.uni.torun.pl \
    --to=golbi@mat.uni.torun.pl \
    --cc=ahu@ds9a.nl \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wrona@mat.uni.torun.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox