title: Google Javascript v8 - multithreading
body: <p>Suppose I have the following piece of code</p>
  
  <pre><code>bool run (void)
  {
      HandleScope hande_scope;
      Handle&lt;String&gt; source;
      Local&lt;Script&gt; script;
      Persistent&lt;Context&gt; context;
  
      context = Context::New();
      Context::Scope context_scope(context);
  
      script = Script::Compile("var a = 1; var b = 2;");
      Local&lt;Value&gt; result = script-&gt;Run();
  
      if (result.IsEmpty())
          return false;
      else
          return true;
  
  }
  </code></pre>
  
  <p>Is it true that one cannot execute this code using multiple threads? It seems like <code>HandleScope</code> is not designed to be used in multithreaded applications.
  I can use the <code>v8::Locker</code> and <code>v8::Unlocker</code> methodes but that would always give me execution traces as this:</p>
  
  <pre><code>t1: a = 1
  t1: b = 2
  
  t2: a = 1
  t2: b = 2
  </code></pre>
  
  <p>I hope someone can give me a hint on getting this code multithreaded so that a possible execution trace could like this:</p>
  
  <pre><code>t1: a = 1
  t2: a = 1
  
  t1: b = 2
  t2: b = 2
  </code></pre>