I’m with Massimo. I guess I don’t understand what you’re trying to do. I use 
globals all the time (and I know others do too), but it’s something like this:

if {![info exists ::some_global_info]} {
    set ::some_global_info [load_global_info]
}

What that does is load some settings or information from file into the global 
scope, but it only loads it once when the child is first created or used. It 
loads the data, and from there on out, the global data exists and so doesn’t 
need to load again. It could just as easily from a DB or anywhere.

This is a pretty common technique for saving resources. Load the info once, on 
startup, and then never load it again. Of course, it means you’ll have to 
restart the server if you want to load new data, but it’s still way more 
efficient than fetching data on every  request.

D


> On Jun 15, 2015, at 11:16 AM, Massimo Manghi <[email protected]> wrote:
> 
> On 06/14/2015 12:03 AM, Paolo Bevilacqua wrote:
>> I got close to get persistent variables by setting all Server values to
>> 1, but still a new process is forked occasionally, because it seems like
>> Apache lives by that.
>> One possibility of limited complexity and no disk access would be using
>> the Apache env variables.
>> I see how to access them in Rivet, but not how to set ?
> 
> Frankly Paolo, I don't understand your goal now. What are you trying to 
> achieve exactly?
> 
> Changing an environment variable in a process would not affect the same 
> variable in the parent and other children's environment. The good old VAX/VMS 
> system developed by DEC had system wide environment variables but they had no 
> locking mechanism and updating them required specific privilege usually not 
> granted to the application level. And even if you foolishly granted this 
> privilege you had the problem of finding a way to synchronize the access to 
> them through some locking mechanism, which would bring you back to the 
> problem of finding a consistent IPC mechanism.
> 
> But after all I didn't understand how you hoped to get system wide symbols by 
> using Tcl global variables
> 
> -- Massimo
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to