title: Multi-core Android
body: <p>I have run simple parallel algorithm drawing the mandelbrot set to test parallel computations on a Nexus 7 (Tegra 3, 4+1 cores).  After running several times I get 1.5 seconds for serial and 1.0 for parallel, but parallel and serial come really close to each other at 1.3 seconds.</p>
  
  <p>The square is 700x700 pixels, and the mandelbrot code I use is from </p>
  
  <p><a href="http://rosettacode.org/wiki/Mandelbrot_set#Java" rel="noreferrer">http://rosettacode.org/wiki/Mandelbrot_set#Java</a></p>
  
  <p>The parallel implementation runs two halves of mandelbrot like this</p>
  
  <pre><code>    public void mandelbrotParallel() {
      Thread t1 = new Thread(new Runnable() {
          public void run() {
              mandelbrotOne();
          }
      });
      Thread t2 = new Thread(new Runnable() {
          public void run() {
              mandelbrotTwo();
          }
      });
      t1.start();
      t2.start();
      try {
          t1.join();
          t2.join();
      } catch (InterruptedException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
      mHandler.post(new Runnable() {
          public void run() {
              v.setBmp(bmp);
              v.invalidate();
          }
      });
  }
  </code></pre>
  
  <p>I have run a simple vector addition before and found similar anecdotal results (no scientific rigor).  So I wonder if there is anything special one has to do to get Android to fire up multiple cores to get a task done.  </p>
  
  <p>Based on quick conversations with Google, it could be that the cores are dormant and wait for the computation to be truly long running (multiple seconds) before the cores are turned on... Is this true ?  If so, are there API calls from Java (no JNI) that can be done to preemptively wake up the cores ?</p>