Skip to content

Commit

Permalink
Turn on multi-thread decode
Browse files Browse the repository at this point in the history
  • Loading branch information
tyronen committed Jul 20, 2015
1 parent 3c885d8 commit 20079bb
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import com.facebook.common.executors.SerialDelegatingExecutor;

/**
* Basic implementation of {@link ExecutorSupplier}.
*
* <p> Provides one thread pool for the CPU-bound operations and another thread pool for the
* IO-bound operations. Decoding, a CPU-intensive operation, is limited to one thread.
* IO-bound operations.
*/
public class DefaultExecutorSupplier implements ExecutorSupplier {
// Allows for simultaneous reads and writes.
Expand All @@ -30,7 +28,6 @@ public class DefaultExecutorSupplier implements ExecutorSupplier {

private final Executor mIoBoundExecutor;
private final Executor mCpuBoundExecutor;
private final Executor mDecodeExecutor;

public DefaultExecutorSupplier() {
mIoBoundExecutor = Executors.newFixedThreadPool(NUM_IO_BOUND_THREADS);
Expand All @@ -43,7 +40,6 @@ public DefaultExecutorSupplier() {
KEEP_ALIVE_SECONDS, // amount of seconds each cached thread waits before being terminated
TimeUnit.SECONDS,
new SynchronousQueue<Runnable>());
mDecodeExecutor = new SerialDelegatingExecutor(mCpuBoundExecutor);
}

@Override
Expand All @@ -58,7 +54,7 @@ public Executor forLocalStorageWrite() {

@Override
public Executor forDecode() {
return mDecodeExecutor;
return mCpuBoundExecutor;
}

@Override
Expand Down

0 comments on commit 20079bb

Please sign in to comment.