From: Rob McCool <robm@netscape.com> Newsgroups: netscape.devs-nsapi Subject: Re: Global variables? Date: Thu, 24 Oct 1996 15:37:15 -0700 > I know this has been asked before, but I can't seem to locate any > references at the moment: > > In a system where a block of memory needs to be accessed by all > threads, but that does not need to be protected by sempahores (ie. no > updates), how can I set this global variable up so that it can be > accessed across the board? I'm not too keen on going to shared memory > (no need for the overhead). Any ideas would be appreciated.If you run your 2.x server with one process, then you won't have to worry about shared memory.
If the table is not going to be changed, then you should probably set up the table during an Init function. It will then be inherited by all of the children. If you need to make an update at any time after the Init function, then you'll have to use shared memory.
-- Rob McCool, robm@netscape.com http://home.netscape.com/people/robm/ Stunt Programmer, Netscape Communications Corporation It was working ten minutes ago, I swear...Reproduced by permission of the author.