X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Thu, 3 Mar 2011 17:32:29 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: 1.7.8: mq_timedreceive() blocks, mq_receive() with O_NONBLOCK blocks, too
Message-ID: <20110303163229.GA14481@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <0C11C5BF0B29FD43A8D0250F711D497F89D5AD0D39@ex01-ubitronix.ubitronix.local> <20110303111350.GC16272@calimero.vinschen.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20110303111350.GC16272@calimero.vinschen.de>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Mar  3 12:13, Corinna Vinschen wrote:
> On Mar  3 10:57, Manuel Wienand wrote:
> > Hi,
> > 
> > I have a problem with the mqueues.
> > If I use mq_timedreceive() and do not set O_NONBLOCK, mq_timedreceive() blocks forever and eats 100% of one cpu core.
> > If I use mq_receive() and set O_NONBLOCK, mq_receive() blocks forever (0% cpu).
> 
> Thanks for the testcase!  I can reproduce it.  I'm a bit out of
> spare time right now, but I think I'll have a fix soon.  Stay tuned.

Ok, I applied a patch to fix the mq_timedreceive problem.  mq_timedsend
was affected by this problem as well.  I'm just generating a new
developer snapshot for testing.

The other problem is a PEBKAC, though.  Here's the open call from your
testcase, which you used to reproduce the mq_receive block if O_NONBLOCK
is given.  For clearness, I split the arguments into multiple lines:

  msgQueue = mq_open(QUEUE_NAME,
                     O_RDWR | O_CREAT | O_EXCL,
                     S_IRWXU | S_IRWXG | O_NONBLOCK,
                     &attrQueue);

Do you see the problem?

Anyway, in the meantime the new snapshot has been uploaded.  Please try
the latest developer snapshot from http://cygwin.com/snapshots/

Thanks again for the testcase.  Debugging and fixing bugs is a lot more
fun with those.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

