From owner-freebsd-questions@FreeBSD.ORG Tue Feb 22 06:39:44 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 C441016A4CE for ; Tue, 22 Feb 2005 06:39:44 +0000 (GMT) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7940A43D1D for ; Tue, 22 Feb 2005 06:39:43 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-a178.otenet.gr [212.205.215.178]) j1M6cLrS019404; Tue, 22 Feb 2005 08:38:29 +0200 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.3/8.13.3) with ESMTP id j1M6cBes001814; Tue, 22 Feb 2005 08:38:11 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.13.3/8.13.3/Submit) id j1M6cBlj001813; Tue, 22 Feb 2005 08:38:11 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Tue, 22 Feb 2005 08:38:11 +0200 From: Giorgos Keramidas To: Jonathon McKitrick Message-ID: <20050222063810.GA1784@gothmog.gr> References: <20050222055000.GA49525@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050222055000.GA49525@dogma.freebsd-uk.eu.org> 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 06:39:44 -0000 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.