This is the mail archive of the
mailing list for the GCC project.
Re: shared libg2c?
- To: toon at moene dot indiv dot nluug dot nl
- Subject: Re: shared libg2c?
- From: Marc Espie <espie at quatramaran dot ens dot fr>
- Date: Thu, 9 Nov 2000 15:08:22 +0100
- Cc: gcc at gcc dot gnu dot org
- Organization: Ecole Normale Superieure (quatramaran)
- References: <email@example.com><39FDCF4D.92E16BD3@moene.indiv.nluug.nl> <firstname.lastname@example.org>
In article <39FF3F64.A9F48A0D@moene.indiv.nluug.nl> you write:
>> >>>>> "Toon" == Toon Moene <email@example.com> writes:
>> Toon> firstname.lastname@example.org wrote:
>> >> I suggest libgc2 be installed shared as well as archive, where
>> >> supported.
>> Toon> Note that for libg2c being installed shared *usefully* first
>of all the
>> Toon> code has to be made reentrant.
>> I don't understand. Could you please elaborate? Specifically, why is
>> it useful to have a non-reentrant archive lib, but it's not useful if
>> it's compiled as a shared lib?
>Because it is not useful to have a non-reentrant shared lib, period :-)
>The code (*all* code) in a shared library has to support multiple
>execution threads, because only one copy of the code is present,
>regardless of the number of "users" (i.e. callers of routines inside
>said shared library).
You're probably refereing to a windows model, or something.
On Unix systems, static variables end up in a data section, so that each
process gets its own copy of the data (copy-on-write, no less, so that
it stays shared until you modify it).
What you're refering to is only useful for multi-threading, there is
absolutely no reason to require it for shared libraries. In fact, most
shared libraries out there are not thread-safe.