From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,92f31bafc1256763 X-Google-Attributes: gidfee84,public X-Google-Thread: f678f,fb7d30cdbe7debec X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1993-07-19 12:00:34 PST Xref: gmd.de comp.unix.osf.osf1:638 comp.unix.osf.misc:342 Path: gmd.de!xlink.net!howland.reston.ans.net!spool.mu.edu!think.com!paperboy.osf.org!osf.org!sp From: sp@osf.org (Simon Patience) Newsgroups: comp.unix.osf.osf1,comp.unix.osf.misc Subject: Re: DCE/Posix threads Date: 16 Jul 1993 08:45:10 GMT Organization: Open Software Foundation Distribution: na Message-ID: <225pqm$2ha@paperboy.osf.org> References: NNTP-Posting-Host: mirabeau.gr.osf.org In article , 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