if you are going to go to that much trouble, you may want to learn the C side of FS coding. C++ also is valid in modules.
I already was leaning away from this global variable thing because it's not enterprise scalable (N-dimensional) but it was harmless to add the patch. On Tue, Jun 1, 2010 at 4:00 PM, David Swardstrom <dswardst...@remotelink.com > wrote: > I got so involved in getting the proposed optional third parameter to > setGlobalVariable() that I did not consider all of the possibilities. > > Using the change along with getGlobalVariable() is ok for data that > would only change or for data that does not need to be completely unique. > > I also have a need to have a global counter that can both be incremented > and decremented. This counter is designed to give me more control over the > number of calls than the current mod_limit will provide. > This would be used during a period where they may be several calls > either entering the system, exiting the system, or both. > > It would be nice to have routines that would just increment or decrement > safely. They would be much faster. > > I have spent the last couple of years working with Visual Studio and C++. > The natural solution I would take in this situation would be to use > InterlockedIncrement() and InterlockedDecrement(). > In this environment I don't think I want to propose this. > > What I would like to propose is the following set of routines > (using JavaScript notation): > // Initialize the counter to a specified value > initGlobalCounter(string name of variable, initial value); > > // Add a value to the global counter > addGlobalCounter(string name of variable, value to add); > > // Subtract a value from the global counter > reduceGlobalCounter(string name of variable, value to subtract); > > I am open to suggestions as to names of the routines. > Even though all I need (now) is increment and decrement, since > the code will need to use the Global Variable Mutex locks, it > might as will be more general. > > Regards, > Paul David Swardstrom > > > _______________________________________________ > FreeSWITCH-dev mailing list > FreeSWITCH-dev@lists.freeswitch.org > http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev > http://www.freeswitch.org > -- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_miness...@hotmail.com <msn%3aanthony_miness...@hotmail.com> GTALK/JABBER/PAYPAL:anthony.miness...@gmail.com<paypal%3aanthony.miness...@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:8...@conference.freeswitch.org <sip%3a...@conference.freeswitch.org> googletalk:conf+...@conference.freeswitch.org<googletalk%3aconf%2b...@conference.freeswitch.org> pstn:+19193869900
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org