On Sunday, November 20, 2011 03:01:57 AM Peter Samuelson wrote: > [Paul Elliott] > > > B > > > > > If all linkings are shared, it is my understanding that the global > > > state of the multiple-linked library would be shared by all > > > references. > > > > Statement A and B above seem to contradict each other. > > > > If global state means global variables, my experiments show that B is > > not true but A is true. > > No, what he meant is: if you link to libraries 'foo' and 'bar', and > library 'foo' also happens to use 'bar', then at runtime there will be > only one copy of 'bar' in your process address space. If library 'bar' > is not reentrant and has shared state, this shared state will affect > functionality used by both your base program and library 'foo'. > > This is all within a single process. Multiple processes don't affect > each other unless, as others have noted, you explicitly set up shared > memory and the like. Ok I understand what you meant now. I take it I am correct that non-reentrant libraries are allowed, and that non- reentrantcy is no reason to link staticly? Thank You for your answers. -- Paul Elliott 1(512)837-1096 pelliott@BlackPatchPanel.com PMB 181, 11900 Metric Blvd Suite J http://www.free.blackpatchpanel.com/pme/ Austin TX 78758-3117
Description: This is a digitally signed message part.