*nix shared libraries don't work like that. The code is shared - the data is always copied.
If you want shared data - you get to create a shared memory segment.
Then synchronize access to that shared memory segment.
PS:
If you're only talking about one PROGRAM (one "process") - then just declare a global variable.
The variable will be "global" in exactly one place (in your program or in one of the .so's: it doesn't matter) and it will be "extern" everywhere else.
Last edited by paulsm4; 03-22-2006 at 02:22 PM.
|