You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import scala.concurrent._
import scala.concurrent.ExecutionContext.Implicits.global
val NUM_SAMPLES = 1000000
var count = 0
Future({
count += spark.sparkContext.parallelize(1 to NUM_SAMPLES).map{i =>
Thread.sleep(2)
val x = Math.random()
val y = Math.random()
if (x*x + y*y < 1) 1 else 0
}.reduce(_ + _)})
Future({
count += spark.sparkContext.parallelize(1 to NUM_SAMPLES).map{i =>
Thread.sleep(2)
val x = Math.random()
val y = Math.random()
if (x*x + y*y < 1) 1 else 0
}.reduce(_ + _)})
OutputCell.HIDDEN
should get 2 progress bars at the same time
The text was updated successfully, but these errors were encountered:
should get 2 progress bars at the same time
The text was updated successfully, but these errors were encountered: