https://kotlinlang.org logo
#getting-started
Title
# getting-started
g

gbm

03/15/2017, 1:27 PM
that is the code with task
Copy code
fun task(start: Int, end: Int) {
            println("Start: $start; End: $end")
            for (i in start until end) distances[i] = Distance(i, euclideanDist(dataSet[i], example))
            latch.countDown()
        }

        for (i in 1..cores) {
            pool.execute { task(startIndex, endIndex) }
            startIndex = endIndex
            endIndex = if (i < cores - 1) endIndex + length else dataSet.size
        }