Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: sp@osf.org (Simon Patience)
Subject: Re: DCE/Posix threads
Date: 16 Jul 1993 08:45:10 GMT	[thread overview]
Message-ID: <225pqm$2ha@paperboy.osf.org> (raw)
In-Reply-To: GRUNWALD.93Jul15185451@frob.cs.colorado.edu

In article <GRUNWALD.93Jul15185451@frob.cs.colorado.edu>, grunwald@frob.cs.colorado.edu (Dirk Grunwald) writes:
> I need to know how DCE/Posix threads access per-pthread information.

DCE threads are 1003.4a Draft 4 based I believe.
There are three calls to manage thread specific data.
	pthread_keycreate(pthread_key_t *key,
			  void (*destructor)(void *));
	pthread_get_specific(pthread_key_t *key,
			     void **value);
	pthread_set_specific(pthread_key_t *key,
			     void *value);

The key can be set up at any time and is usable by any thread. Threads
then associate any value they wish to the key, which will be stored in per
thread way by the threads library. You can create a number of these keys.

The pthread_get_specific() interface has changed slightly in later drafts
to return the value rather than storing it the location indicated by the
parameter, but this will not be implemented yet.

> On our KSR-1, there is a compiler directive '__private' that lets me
> indicate a copy of that variable should be allocated for each pthread
> that is created. There is no such directive on our DEC AXP 3000/400.

While the __private key may seem very useful, you will have noticed that it
doesn't lead to portable code.

Simon.

-- 
  Simon Patience
  Open Software Foundation			Phone: +33-76-63-48-72
  Research Institute				FAX:   +33-76-51-05-32
  2 Avenue De Vignate				Email: sp@gr.osf.org
  38610 Gieres, France				       uunet!gr.osf.org!sp


  reply	other threads:[~1993-07-16  8:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-07-16  0:54 DCE/Posix threads Dirk Grunwald
1993-07-16  8:45 ` Simon Patience [this message]
1993-07-16 12:17 ` Neil Winton
1993-07-16 22:58 ` Greg Brail
  -- strict thread matches above, loose matches on Subject: below --
1993-07-16  0:59 Dirk Grunwald
     [not found] <1993Jul16.010227.13204@colorado.edu>
1993-07-16  1:11 ` Dirk Grunwald
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox