From owner-freebsd-questions@FreeBSD.ORG Tue Feb 22 12:19:16 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 410C616A4CE for ; Tue, 22 Feb 2005 12:19:16 +0000 (GMT) Received: from xenial.mcc.ac.uk (xenial.mcc.ac.uk [130.88.203.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id A75C743D55 for ; Tue, 22 Feb 2005 12:19:15 +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 1D3Z0U-000BYv-OJ; Tue, 22 Feb 2005 12:19:14 +0000 Received: from dogma.freebsd-uk.eu.org (localhost [127.0.0.1]) j1MCJDdM063278; Tue, 22 Feb 2005 12:19:14 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 j1MCJBZk063277; Tue, 22 Feb 2005 12:19:11 GMT Date: Tue, 22 Feb 2005 12:19:11 +0000 From: Jonathon McKitrick To: Giorgos Keramidas Message-ID: <20050222121911.GA63213@dogma.freebsd-uk.eu.org> References: <20050222055000.GA49525@dogma.freebsd-uk.eu.org> <20050222063810.GA1784@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050222063810.GA1784@gothmog.gr> 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: Tue, 22 Feb 2005 12:19:16 -0000 On Tue, Feb 22, 2005 at 08:38:11AM +0200, Giorgos Keramidas wrote: : On 2005-02-22 05:50, Jonathon McKitrick wrote: : > : > Hi all, : > I'm porting some libraries from Win32 to BSD/Linux. In the original : > code, I receive a Windows event with an attached COM object. : > : > Under *nix, what is the best way to copy this? A message, followed : > by accessing shared memory between threads? : : Does the message really have to be shared across many threads? I'm : only asking because thread-specific message queues are not that hard : to build with pthreads. You will only need a per-thread queue to hold : messages and a master thread that 'dispatches' messages to the proper : thread/queue. Well, there will be a data acquisition thread, that when finished, will need to signal the main processing thread that a new data object has arrived. Jonathon McKitrick -- My other computer is your Windows box.