>> Because the only segment of a program that
>> can be shared is the text segment. All other
>> segments (data and bss for globals and local
>> statics) are constructed from the executable
>> files at runtime and every process has its own
>> data, bss, heap and stack segments.
>> The text segment is the one that holds the
>> instructions. But text doesn't hold any data.
[Aside: data segments are indeed shared, on most modern
VM OS's including Linux, via copy-on-write. There's no
way to use this fact for IPC, though, which seems to
be what you are interested in.]
> Is there a way somehow to make a data
> segment which would be shared among the instances?
I haven't seen the beginning of this thread, so
sorry if this isn't what you're looking for:
And make sure your kernel is built with "System V IPC"
-- Joseph Knapka
"If I ever get reincarnated... let me make certain I don't come back
as a paperclip." -- protagonist, H Murakami's "Hard-boiled Wonderland"
// Linux MM Documentation in progress:
* Evolution is an "unproven theory" in the same sense that gravity is. *