Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 May 1997 19:10:36 -0500 (CDT)
From:      "Daniel M. Eischen" <deischen@iworks.InterWorks.org>
To:        terry@lambert.org
Cc:        freebsd-hackers@FreeBSD.ORG, jb@freebsd1.cimlogic.com.au
Subject:   Re: GNAT-pthreads integration bugs/questions
Message-ID:  <199705190010.TAA21397@iworks.InterWorks.org>

next in thread | raw e-mail | index | archive | help
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705190010.TAA21397>