Subj : Asynchronous event during script execution To : netscape.public.mozilla.jseng From : yiftahf Date : Thu Oct 06 2005 03:08 am Hi, I want to create a framework for executing script and maintaining an event queue for events during this script execution. Here is what I thought of: Obviously I will need 2 thread one executing the script and the other waiting for events. The 2 threads will have seperate contexts but share the same global object and thus both will access to the same global data. (I know this might cause race condition but this under the scope of my framework). The events will be generated by the C code and I want each event to cause a function invokation in the javascript shared by the two threads. Now here are my questions: 1 . How do I compile a script in one context for sqeuntal execution and share it with the other context(thread) so it will call a special functions in this script? 2. Did some one try this model (or something similar). Are there any additional pitfalls I'm missing? Thanks in advance, Yiftah .