Thank you all for the answers, this is exactly what I was looking for. Jean-Fabrice, merci pour ton soutient.
On 20/03/2008, Robert Seeger <[EMAIL PROTECTED]> wrote: > Because your question makes it sound like you might be misunderstanding > some things... > > When you set a global variable (global bob ; set bob 1) during the > evaluation of your page, that variable exists only in the interpreter > that is being used for your page. There are many interpreters (one per > thread, and a new one created every time a new thread is created), and > your global variable is not shared across them [1] and (generally) is > cleaned up after each request. > > The nsv_* commands set a key/value that is shared across all threads and > persist for the life of the server. > > Rob Seeger > > [1] The global variables can, in certain circumstances, persist across > calls. However, you still aren't likely to see them during other page > requests. You'll only see them when you happen to have your page served > by the same interpreter that you originally set the global variable in. > > > Bas Scheffers wrote: > > You can use nsv shared variables, which makes the variable shared by > > all threads. You can initialize these values in a library Tcl file, > > like init.tcl. > > > > See: http://panoptic.com/wiki/aolserver/Thread-shared_Variables > > > > A second (and possibly better) way is to set these values in a section > > of your config file (nsd.tcl). You can then access them using the > > ns_config command. > > > > Bas. > > > > On 20/03/2008, at 8:51 AM, Xavier Bourguignon wrote: > > > >> Hi, > >> > >> Is there a way to set a global which stays in memory for the life of > >> the server and not just for the life of a request? > >> > >> I am asking this because I want to set some server wide configuration > >> items and I do this at the moment: > >> > >> global CFG > >> > >> set CFG(ITEM_1) val_1 > >> set CFG(ITEM_2) val_2 > >> > >> But unfortunately, it seems that this global does not stay in memory > >> for any longer than the life of 1 request. > >> > >> Thank you > >> > >> -- > >> Xavier Bourguignon > >> > >> > >> -- > >> AOLserver - http://www.aolserver.com/ > >> > >> To Remove yourself from this list, simply send an email to > >> <[EMAIL PROTECTED]> with the > >> body of "SIGNOFF AOLSERVER" in the email message. You can leave the > >> Subject: field of your email blank. > > > > > > -- > > AOLserver - http://www.aolserver.com/ > > > > To Remove yourself from this list, simply send an email to > > <[EMAIL PROTECTED]> with the > > body of "SIGNOFF AOLSERVER" in the email message. You can leave the > > Subject: field of your email blank. > > > > > -- > AOLserver - http://www.aolserver.com/ > > To Remove yourself from this list, simply send an email to <[EMAIL > PROTECTED]> with the > body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: > field of your email blank. > -- Xavier Bourguignon -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.