🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #1849

Re: Static variables in DLL's == shared memory ???

#1849
From: David Bolen
Date: Wed, 11 Nov 1992 14:26
23 lines
1608 bytes
In article <1992Nov11.164359.2195@cs.tu-berlin.de> ernst@opal.cs.tu-berlin.de (Ernst Kloecker) writes:

>If I load a DLL containing static variables at runtime and the same DLL
>is loaded by another process, is the static data shared between the two
>processes ? (Hopefully not ;-)

It depends on how you define your DATA segments in your linker
definition file.  If you defined them as shared, then yes, all
processes using the DLL will see the same static storage.  If you
define it as nonshared (more typical) than each process will get it's
own copy.

Having them all share static data space can prove very convenient in
some cases, but you do have to be careful.

--
-- David
--
/-----------------------------------------------------------------------\
 \              David Bolen             \  Internet: db3l@ans.net      /
  |   Advanced Network & Services, Inc.   \   Phone: (914) 789-5327   |
 / 100 Clearbrook Road, Elmsford, NY 10523  \   Fax: (914) 789-5310    \
\-----------------------------------------------------------------------/
Technical Details
Message-ID: <1992Nov11.192049.14742@ans.net>
Path: arc1-ca.pugleaf.net!sparky!uunet!destroyer!gatech!news.ans.net!ans.net!db3l
References: <1992Nov11.164359.2195@cs.tu-berlin.de>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.os2.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!destroyer!gatech!news.ans.net!ans.net!db3l
From: db3l@ans.net (David Bolen)
Subject: Re: Static variables in DLL's == shared memory ???
Sender: news@ans.net (News Administrator)
Message-ID: <1992Nov11.192049.14742@ans.net>
In-Reply-To: ernst@opal.cs.tu-berlin.de's message of Wed, 11 Nov 1992 16: 43:59 GMT
Date: Wed, 11 Nov 1992 14:26:14 GMT
References: <1992Nov11.164359.2195@cs.tu-berlin.de>
Organization: Advanced Network & Services, Inc. - Elmsford, NY
Lines: 23