From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 15 18:19:26 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD60416A4CE for ; Tue, 15 Mar 2005 18:19:26 +0000 (GMT) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 44ACE43D49 for ; Tue, 15 Mar 2005 18:19:26 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) j2FIJPse029322; Tue, 15 Mar 2005 13:19:25 -0500 (EST) Date: Tue, 15 Mar 2005 13:19:25 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: "Michael C. Shultz" In-Reply-To: <200503150948.01624.ringworm01@gmail.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) cc: freebsd-hackers@freebsd.org Subject: Re: threads question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Daniel Eischen List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2005 18:19:27 -0000 On Tue, 15 Mar 2005, Michael C. Shultz wrote: > > Daniel, sorry to bother you again but I ran into something that is > either a bug or I am missing a vital piece of information somewhere. > Here is the situation: > > this works perfectly because I moved MGPMrUpgrade into > the same .c file so it would be a static function: > > structProperty* property; > pthread_t threads[NTHREADS]; > pthread_create( &threads[0], NULL, zzMGPMrUpgrade, property ); > > When I use MGPMrUpgrade from a shared library the function runs > yet property isn't being passed! > > I remember from assembly days that there were some stack tricks to be > done when making calls to a shared library in order to pass the > parameters, I forget what they are (been ages since I did assembly > programming) but anyways it seems like with gcc passing the args > through the stack to a function in a shared library isn't being handled > correctly. Am I missing something obvious? I don't know. You have to be sure that whatever property points to stays valid for the life of the thread (or at least as long as it is used). -- DE