shared variables in shared libraries

shared variables in shared libraries

Post by Peter Huan » Thu, 10 Aug 2000 04:00:00



Hi all

Can any one tell me how to allow applications using  a dll to share a single
instance of a variable inside the dll.

Peter

 
 
 

shared variables in shared libraries

Post by Kaz Kylhe » Thu, 10 Aug 2000 04:00:00



>Hi all

>Can any one tell me how to allow applications using  a dll to share a single
>instance of a variable inside the dll.

Linux doesn't have DLL's; try a Windows newsgroup.  

What you seem to be asking about is how to share memory between applications.
That is done using system calls like shmget and shmat for the System V style
shared memory, or using mmap.

But consider using some IPC mechanism like sockets instead.

--
Any hyperlinks appearing in this article were inserted by the unscrupulous
operators of a Usenet-to-web gateway, without obtaining the proper permission
of the author, who does not endorse any of the linked-to products or services.

 
 
 

1. Shared variable between main() and loaded shared library - dlopen()

I created an executable that loads a shared library via dlopen().
The main program and the shared library use an identical object file
at link time. I expect the address of a particular variable to be
different at runtime, but I notice that the variable is actually identical
by address.
What needs to be done in order for the variable to have
2 separate addresses. Is it a link issue ? Is it an different option
in dlopen() ? I am using the standard C++ compiler (xlC_r) and
makeC++SharedLib_r.
This behavior appears also under HP-UX, Linux and Solaris.
Thanks for your help.

2. X vs iBooks

3. Will strip(debug shared library) == nodebug shared library ?

4. FTP

5. Help with building shared libraries with dependencies on other shared libraries

6. Hardware Helper

7. Question: Inclusion of shared libraries during linking of shared libraries

8. Problem with cron & mount

9. Shared library loading shared library.

10. Need a Shared Library Guru: beyond simple shared library question

11. When is a shared library not a shared library?

12. Shared libraries sharing from main app?

13. error in loading shared libraries: libXmu.so.6: cannot open shared object