From owner-freebsd-hackers Sun May 18 17:08:54 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id RAA22229 for hackers-outgoing; Sun, 18 May 1997 17:08:54 -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 RAA22224 for ; Sun, 18 May 1997 17:08:52 -0700 (PDT) Received: (from deischen@localhost) by iworks.InterWorks.org (8.7.5/) id TAA21397; Sun, 18 May 1997 19:10:36 -0500 (CDT) Message-Id: <199705190010.TAA21397@iworks.InterWorks.org> Date: Sun, 18 May 1997 19:10:36 -0500 (CDT) From: "Daniel M. Eischen" To: terry@lambert.org Subject: Re: GNAT-pthreads integration bugs/questions Cc: freebsd-hackers@FreeBSD.ORG, jb@freebsd1.cimlogic.com.au Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > This is a bogosity of POSIX threads. It comes from the idea that thread > stacks can't be alloed to auto-grow. This is a stupid idea, and should > be done away with in the POSIX standard. Preallocating a set stack > size is Just Plain Wrong(tm). > > With an rfork, you will get another process with it's own stack, so > the stack auto-grows: there's no need to make the call to "set it > larger than the default" like there is with bogus implementations > of thread stacks. OK > > mutexes and condition variables (could use SYSV semaphores I suppose), > > Yes, or socketpair() or some other blocking IPC mechanism, like the > SysV stuff. There is a real lack of synchronization primitives in > UNIX. I was also looking at flock(). > > and the ability to create a key (pthread_key_create) that is specific > > to each process - like taskVarAdd() in VxWorks :-) > > Why not call getpid()? 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. Dan Eischen deischen@iworks.InterWorks.org