From owner-freebsd-questions@FreeBSD.ORG Wed Feb 23 03:58:08 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2583C16A4CE for ; Wed, 23 Feb 2005 03:58:08 +0000 (GMT) Received: from xenial.mcc.ac.uk (xenial.mcc.ac.uk [130.88.203.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BEC943D1D for ; Wed, 23 Feb 2005 03:58:07 +0000 (GMT) (envelope-from jcm@FreeBSD-uk.eu.org) Received: from dogma.freebsd-uk.eu.org ([130.88.200.97]) by xenial.mcc.ac.uk with esmtp (Exim 4.43 (FreeBSD)) id 1D3nf4-0007NK-NR; Wed, 23 Feb 2005 03:58:06 +0000 Received: from dogma.freebsd-uk.eu.org (localhost [127.0.0.1]) j1N3w5Gt096273; Wed, 23 Feb 2005 03:58:06 GMT (envelope-from jcm@dogma.freebsd-uk.eu.org) Received: (from jcm@localhost) by dogma.freebsd-uk.eu.org (8.13.1/8.12.6/Submit) id j1N3w45Q096272; Wed, 23 Feb 2005 03:58:05 GMT Date: Wed, 23 Feb 2005 03:58:04 +0000 From: Jonathon McKitrick To: Giorgos Keramidas Message-ID: <20050223035804.GA95877@dogma.freebsd-uk.eu.org> References: <20050222055000.GA49525@dogma.freebsd-uk.eu.org> <20050222063810.GA1784@gothmog.gr> <20050222121911.GA63213@dogma.freebsd-uk.eu.org> <20050222124244.GA80450@orion.daedalusnetworks.priv> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050222124244.GA80450@orion.daedalusnetworks.priv> User-Agent: Mutt/1.4i cc: freebsd-questions@freebsd.org Subject: Re: Best way to share data between threads X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2005 03:58:08 -0000 On Tue, Feb 22, 2005 at 02:42:44PM +0200, Giorgos Keramidas wrote: : 1) Explicit notification using a condition variable. : : The first can be accomplished by associating a pthread_cond_t with the I think this is the approach I will use. As a matter of fact, I added it today for a different, more limited use, and it worked well. We have an instrument that needs firmware ftp'ed to it after a cold start, and I placed that into a pthread. I'll try the data acq thread soon. The only problem is that pthread_join doesn't seem to have a timeout feature. So if the thread hangs, I have no way of knowing. Jonathon McKitrick -- My other computer is your Windows box.