home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.os2.programmer
- Path: 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
-
- 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 \
- \-----------------------------------------------------------------------/
-