Okay, with the help of some of my peers, I've solved the mystery surrounding the seemingly redundant SINGLE/MULTIPLE and SHARED/NONSHARED attributes.
First, some prep up work...
Every DLL needs and gets a data segment ("automatic data segment"). It is the place where the DLL stores all its STATIC data--basically the data declared in the DLL module but declared outside any function AND (I venture) variables declared STATIC within a DLL function as well. The STACK is NOT!! part of a DLL's automatic data segment (thoug it seems to be for an EXE). The stack that is used when 'running' a DLL function is that of the calling thread.
Now here's the clincher...
DLLs CAN ALSO HAVE ADDITIONAL DATA SEGMENTS!! (as can EXEs, I imagine)
Bingo! Now we understand why there are two different sets of attributes--specifically, NONE/SINGLE/MULTIPLE and SHARED/NONSHARED. Though they basically do the same thing, they APPLY to different things.
NONE/SINGLE/MULTIPLE
So...to answer my own question >could {someone} explain what the following
statements would >produce:
>
> DATA MULTIPLE SHARED
Every application which links to the DLL will have it's own private copy
of the automatic data segment. If the DLL has no additional data segments,
the SHARED keyword is meaningless and can be omitted. If there are additional
data segments, only one copy of each will exist and they will be shared
by all applications (unless a SEGMENTS statement follows which overrides
this default for a specific segment) > or
> DATA SINGLE NONSHARED
Every application which links to the DLL will share a single automatic data segment (hence, each app that affects the DLL STATIC data will affect it for all apps). If there are no additional data segments, the NONSHARED keyword is meaningless and can be omitted. If there are, a private copy will be created for each app (unless overriden by a SEGMENTS statement).
Note that in the absence of BOTH a SINGLE/MUTLIPLE and SHARED/NONSHARED
keyword, the default is for ALL data segments (automatic and additional
ones) to be shared (i.e., only one copy). In the absence of one OR the other,
but not both, the property of ALL data segments are mandated by the single
keyword. In other words, DATA SINGLE
and
DATA SHARED
do the same exact thing.
Credit: John Cortell