From owner-freebsd-threads@FreeBSD.ORG Wed May 28 18:10:40 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5AA8237B401 for ; Wed, 28 May 2003 18:10:40 -0700 (PDT) Received: from h00609772adf0.ne.client2.attbi.com (h00609772adf0.ne.client2.attbi.com [24.61.43.152]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5AD4743F3F for ; Wed, 28 May 2003 18:10:39 -0700 (PDT) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: from h00609772adf0.ne.client2.attbi.com (localhost.ne.attbi.com [127.0.0.1])h4T1AlSr004197 for ; Wed, 28 May 2003 21:10:48 -0400 (EDT) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)h4T1Al5U004196 for freebsd-threads@freebsd.org; Wed, 28 May 2003 21:10:47 -0400 (EDT) Date: Wed, 28 May 2003 21:10:47 -0400 From: Craig Rodrigues To: freebsd-threads@freebsd.org Message-ID: <20030529011047.GA4182@attbi.com> References: <20030529003416.GA3712@attbi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i Subject: Re: Question about OpenSSL id_function() and pthreads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2003 01:10:40 -0000 On Wed, May 28, 2003 at 08:46:26PM -0400, Daniel Eischen wrote: > > Make an external function (in C) that converts the pthread_t > for you and use that to convert it. How should I do the conversion? On FreeBSD, pthread_t is a pointer to struct pthread. Are there data members in the struct pthread that I can use to construct a unique numeric identifier? > This is a standards question, but is there a reason why > pthread_t can't be a pointer? We can always change the > thread libraries, but that would be a version bump and > doesn't help you right now. There was some discussion about this on freebsd-current in February. See the full thread here: "OpenSSL question for id_function()" http://docs.freebsd.org/mail/archive/2003/freebsd-current/20030302.freebsd-current.html Mike Barcroft quoted a section of the POSIX standard which says that pthread_t must be an arithmetic type. Garrett Wollman indicated that changing the definition of pthread_t to __intptr_t would be one possible solution. -- Craig Rodrigues http://home.attbi.com/~rodrigc rodrigc@attbi.com