delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/08/24/19:01:51

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Wed, 25 Aug 2004 01:02:01 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: 1.5.10: msgsnd between threads hangs, between processes ok..
Message-ID: <20040824230201.GL27978@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <2079E501DCD2FF4096F221E248CB28B04260C0 AT exchange DOT propagatenet DOT com>
Mime-Version: 1.0
In-Reply-To: <2079E501DCD2FF4096F221E248CB28B04260C0@exchange.propagatenet.com>
User-Agent: Mutt/1.4.2i

On Aug 23 14:24, Don Post wrote:
> I have encountered a problem which I hope someone has seen and has a
> work around for. While I was porting some code that is based on POSIX
> threads and SYSV message queues I found that if the receiver (i.e.
> caller to msgrcv) of the message queue is a child or sibling thread of
> the sender (i.e. caller to msgsnd), then the msgsnd call hangs
> indefinitely even though NOWAIT is specified. If the receiver (caller to
> msgrcv) is another process, then all works fine. I have included a
> simple program that spawns the receiver either as a process (i.e. fork)
> or as a thread (pthread_create). When fork is used, all works find. When
> pthread_create is used, the send hangs. Any ideas/workarounds?

The problem is deep inside cygserver.  The current methods only allow
one concurrent call per process.  If one call blocked, the per-process
locking wasn't released, accidentally. 

My fix solves that very problem, so your application won't hang anymore,
but it doesn't change the fact that only one thread per process can run
an IPC call at a time.  I have an idea how to solve that, but that takes
somewhat more time and I'm not sure I want to change that already for the
upcoming Cygwin release.

Thanks for the testcase, it's highly appreciated.  If you want to give
my patch a try, check out the latest Cygwin developers snapshot from
http://www.cygwin.com/snapshots/


Corinna

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

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019