comparison app/src/main/java/com/bartsent/simpleresizer/lib/ThreadPools.kt @ 18:eedf995462d9 concur2

Parallalized, but ConstraintLayout started hosing the edit window.
author David Barts <n5jrn@me.com>
date Mon, 22 Feb 2021 07:04:31 -0800
parents
children
comparison
equal deleted inserted replaced
17:86740f593b6c 18:eedf995462d9
1 package com.bartsent.simpleresizer.lib
2
3 import java.util.concurrent.Executors
4
5 /**
6 * Thread pools. We use just one, and it is sized to the maximum responsible thread use,
7 * which is one more than the number of cores. This is because when scaling, we have one
8 * worker thread sitting around and waiting for the remaining busy ones to finish.
9 */
10 object ThreadPools {
11 val NWORKERS = Runtime.getRuntime().availableProcessors() + 1
12 val WORKERS = Executors.newFixedThreadPool(NWORKERS)
13 }