Advertisement
Guest User

abstractcompute

a guest
Sep 5th, 2011
2,255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. /* SOURCE
  2. http://download.oracle.com/javase/tutorial/essential/concurrency/forkjoin.html
  3. */
  4.  
  5. protected static int sThreshold = 100000;
  6.  
  7.   protected void compute() {
  8.     if (mLength < sThreshold) {
  9.       computeDirectly();
  10.       return;
  11.     }
  12.    
  13.     int split = mLength / 2;
  14.    
  15.     invokeAll(new ForkBlur(mSource, mStart,         split,           mDestination),
  16.               new ForkBlur(mSource, mStart + split, mLength - split, mDestination));
  17.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement