Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Dynamic link library Global data. (http://www.go4expert.com/forums/dynamic-link-library-global-data-t15233/)

rag84dec 23Nov2008 17:46

Dynamic link library Global data.
Hi all,

What is the meaning of DLL's Global data?.If i have a class with member functions,will any member functions
and data members qualify for the global data category?.
How will i make it thread safe?

xpi0t0s 23Nov2008 19:40

Re: Dynamic link library Global data.
Global data in a DLL is exactly what it says, data that is global to the DLL. I'm not sure if it's global to all instances of the DLL (say where three programs are running that each load the DLL); the only time I've done DLL programming was in the Windows 3.x days and I think it might have been. (These days I would expect each process to have separate global DLL data but I'd have to check to be sure.)

Static member functions will act like global data, just as they do in executables, and like global data are worth avoiding if you want to be threadsafe. If you have to have global/static data, then you will need to mutex access to that data (again, just as you would have to in an executable).

All times are GMT +5.5. The time now is 12:32.