Subj : Rhino and multithreading To : netscape.public.mozilla.jseng From : "Barre Dijkstra" Date : Wed Dec 31 1969 04:00 pm Greetings, I am currently banging my head to the wall due to the following problem: I'm looking at rhino for an ecmascript implementation in java. All fine and well, until you start thinking about optimization and threading. What I'm trying to accomplish is that when some script calls certain functions (implemented in an object that extends ScriptableObject that has been added to the applicable contexts) that a new thread is forked for optimization resons (for example, you don't want to halt your whole program when talking to some time consuming process on another machine over sockets). For example: var x = someTimeConsumingFunction(); var y = 12; var z = x + y; How would the interpreter know that someTimeConsumingFunction() is done processing since there are no means to place a lock on either x or timeConsumingFunction(); In other words, has anyone had any experience in synchronization of javascript using rhino, or does anyone know any other javascript engine (in java) that does support threading? Thanks, Barre .