From owner-freebsd-hackers Sun May 18 20:39:40 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id UAA00263 for hackers-outgoing; Sun, 18 May 1997 20:39:40 -0700 (PDT) Received: from iworks.InterWorks.org (deischen@iworks.interworks.org [128.255.18.10]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id UAA00256 for ; Sun, 18 May 1997 20:39:36 -0700 (PDT) Received: (from deischen@localhost) by iworks.InterWorks.org (8.7.5/) id WAA26464; Sun, 18 May 1997 22:41:25 -0500 (CDT) Message-Id: <199705190341.WAA26464@iworks.InterWorks.org> Date: Sun, 18 May 1997 22:41:25 -0500 (CDT) From: "Daniel M. Eischen" To: hackers@FreeBSD.ORG, terry@lambert.org Subject: Re: GNAT-pthreads integration bugs/questions Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > [ ... synchronization primitives ... ] > > > I need to be able to bind a structure (pointer) to a process ID. I > > could maintain a list of process ID/structure pointer pairs and then > > search through the list based on process ID. The pthread_getspecific() > > and pthread_setspecific do this based on the thread ID. The taskVarAdd() > > in VxWorks is even nicer because it automatically swaps the task > > variable for you whenever tasks are swapped - no need to call a get. > > Well, the heap is shared in the RFMEM case. I don't see why you could > not implement it using a global counter, provided it only ever gets > called once per process. > > You could use the counter value locally to index an array of these > structs in the heap. Maybe I'm missing something here ;-) In the GNAT runtime, I need to be able to retrieve a pointer to a structure (Ada Task Control Block) based soley on the PID (assuming we're using rfork). The PID is all we know, and we must be able to find the ATCB for this process. The structures can be in shared data, but I still have to perform some sort of lookup/search to find the ATCB for a process ID. Dan Eischen deischen@iworks.InterWorks.org