From owner-freebsd-threads@FreeBSD.ORG Wed Mar 24 15:56:37 2010 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26E591065672; Wed, 24 Mar 2010 15:56:37 +0000 (UTC) (envelope-from pldrouin@pldrouin.net) Received: from smtp.cyberfingers.net (smtp.cyberfingers.net [198.177.254.227]) by mx1.freebsd.org (Postfix) with ESMTP id 0390C8FC0A; Wed, 24 Mar 2010 15:56:36 +0000 (UTC) Received: from [134.117.23.34] (pldrouinlap2-pc.physics.carleton.ca [134.117.23.34]) by smtp.cyberfingers.net (Postfix) with ESMTP id 065E7AB6C26; Wed, 24 Mar 2010 11:56:35 -0400 (EDT) Message-ID: <4BAA3632.7030309@pldrouin.net> Date: Wed, 24 Mar 2010 11:56:34 -0400 From: Pierre-Luc Drouin User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Daniel Eischen References: <4BA64260.5000009@pldrouin.net> <4BA6A2C5.3030808@pldrouin.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-threads@freebsd.org Subject: Re: Portable Conditional Wait for Inter-Process? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2010 15:56:37 -0000 Hi, finally what I did is to create an array in a shared memory segment (I was already using shared memory for these processes) where I write the PIDs of the waiters such that the other process can SIGALRM them when it is ready. The waiters wait for this signal with sigtimedwait and the other process SIGALRM them as well if a signal is sent to it. I use a lock-free algorithm with atomic primitives to save and load the PIDs to the shared segment. It seems to be working quite well. Thanks Daniel Eischen wrote: > On Sun, 21 Mar 2010, Pierre-Luc Drouin wrote: > >> Regarding process groups, how can I set two processes to belong to >> the same process group if they don't have a parent-child relation? >> >> Thanks! > > Well, from skimming the man pages, I don't think you can > do that. You can't somehow launch your clients and server from > the same parent? >