Subj : Processing multiple scripts using a single runtime-context pair To : netscape.public.mozilla.jseng From : rvivek13@yahoo.com (r vivek) Date : Tue Jan 28 2003 08:19 am Supposing I want to implement a webserver that supports server side scripting. Each request for a page is handled by a thread. I have a pool of runtimes and each request processing thread waits for getting a handle to the runtime pool element (a JSRuntime instance). Once it gets hold of the JSRuntime it creates a context (say CX) to process the whole page. Consider the case in which one of the pages has two scriplets (defined below) in it, //scriplet 1 containing javascript code var myvar = someoperation() // scriptlet 2 containing javascript code // I want to use myvar here .... .... I compile myscript-1, execute it (using JS_ExecuteScript) and destroy the script (using JS_DestroyScript) using CX. After this I process myscript-2 in the same manner as for myscript-1. My question is can I use variable myvar (declared in myscript-1) in myscript-2 (given the fact that I have called JS_DestroyScript and destroyed myscript-1)? Can it get trashed in any way? How can gc have any effect, if any, in this scenario? Regards, Vivek .