Article View: gnu.gcc.help
Article #51570Re: threads, gcc and sunOS
From: Casper H.S. Dik
Date: Wed, 05 May 1993 10:16
Date: Wed, 05 May 1993 10:16
31 lines
2049 bytes
2049 bytes
joe@modcomp.uucp (Joe Korty) writes: >In <1993May3.171615.25882@spectrum.xerox.com> leisner@wrc.xerox.com (Marty Leisner x71348 ) writes: >>This is necessary if each thread gets its own copy of errno... >There are many ways to implement threads without making compiler >changes. For example, the errno problem can be handled by making errno >a macro which expands to the code necessary to fetch and/or modify the >thread-specific errno value. The POSIX 1003.4 thread draft (or >standard?, I haven't been following it lately) would be a good place to >start looking for ideas on this subject. This in itself is true. It is what SGI does in IRIX. But my question is: is it flexible enough? The errno value is stored in some thread-local storage. But suppose I wanted to write my own library with my own errno variable? I could write the functions to get the thread specific values, but how do I create thread local storage for each and every thread? Special casing errno is one step, but I'd like to hear from someone who has a solution that: - has user extensible thread local storage - doesn't require compiler and/or linker support One reason for extensible thread local storage is MT safe libraries. Many unix library calls use some sort of local, static, storage for their return value. If we want to make those calls MT safe, we must be able to allocate some storage, per thread. Casper
Technical Details
Message-ID:
<1993May5.101646.18781@fwi.uva.nl>Path:
arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!mcsun!sun4nl!fwi.uva.nl!casperReferences:
<1993May3.171615.25882@spectrum.xerox.com> <joe.736535562@rlxdev>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,ea0d529a8356594c X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-05-05 03:34:51 PST Newsgroups: gnu.gcc.help Path: arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!mcsun!sun4nl!fwi.uva.nl!casper From: casper@fwi.uva.nl (Casper H.S. Dik) Subject: Re: threads, gcc and sunOS Message-ID: <1993May5.101646.18781@fwi.uva.nl> Sender: news@fwi.uva.nl Nntp-Posting-Host: adam.fwi.uva.nl Organization: FWI, University of Amsterdam References: <1993May3.171615.25882@spectrum.xerox.com> <joe.736535562@rlxdev> Date: Wed, 5 May 1993 10:16:46 GMT Lines: 31