Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: nwinton@axion.bt.co.uk (Neil Winton)
Subject: Re: DCE/Posix threads
Date: 16 Jul 1993 12:17:52 GMT	[thread overview]
Message-ID: <22669g$4oq@zaphod.axion.bt.co.uk> (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.
|> 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.
|> 
|> In the DCE environment, I'm beginning to suspect that you must depend
|> on the intial argument value passed into the thread. Is this the case?
|> Any examples would be helpful.

Sorry I don't have an example to hand, but you should look at the routines
pthread_keycreate(), pthread_setspecific and pthread_getspecific(). These
routines allow "per thread global" information to be stored and retrieved. 
Basically you create a key (which is shared by all threads) and then associate
specific data with it on a per-thread basis.  So you effectively have a key which
"means the same thing" to each thread, but which has a different value for each
thread.  This seems pretty much the semantics of __private you describe above.

|> Thanks,
|> Dirk Grunwald                          Asst. Prof, Univ. of Colorado at Boulder

I haven't used this, so it is just my understanding of the documentation, but I
hope it helps.

	Neil

*   Neil Winton			G306a, SSTF Building	This sentence       *
*   N.Winton@axion.bt.co.uk	BT Laboratories		has two missing,    *
*   Tel +44 473 646079		Martlesham Heath	but you can still   *
*   Fax +44 473 643019		IPSWICH IP5 7RE, UK	sense of it.        *



  parent reply	other threads:[~1993-07-16 12:17 UTC|newest]

Thread overview: 7+ 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
1993-07-16 12:17 ` Neil Winton [this message]
1993-07-16 22:58 ` Greg Brail
  -- strict thread matches above, loose matches on Subject: below --
1993-07-16  0:59 Dirk Grunwald
1993-07-16  1:04 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