just one default thread pool (which is hardwired to Runtime.availableProcessors);
authorwenzelm
Fri Apr 25 22:10:03 2014 +0200 (2014-04-25)
changeset 56731326e8a7ea287
parent 56730 e723f041b6d0
child 56732 da3fefcb43c3
just one default thread pool (which is hardwired to Runtime.availableProcessors);
src/Pure/Concurrent/future.scala
src/Tools/jEdit/etc/settings
     1.1 --- a/src/Pure/Concurrent/future.scala	Fri Apr 25 21:31:39 2014 +0200
     1.2 +++ b/src/Pure/Concurrent/future.scala	Fri Apr 25 22:10:03 2014 +0200
     1.3 @@ -10,16 +10,23 @@
     1.4  
     1.5  
     1.6  import scala.util.{Success, Failure}
     1.7 -import scala.concurrent.{Future => Scala_Future, Promise => Scala_Promise, Await}
     1.8 +import scala.concurrent.{ExecutionContext, ExecutionContextExecutor,
     1.9 +  Future => Scala_Future, Promise => Scala_Promise, Await}
    1.10  import scala.concurrent.duration.Duration
    1.11 -import scala.concurrent.ExecutionContext.Implicits.global
    1.12  
    1.13  
    1.14  object Future
    1.15  {
    1.16 +  lazy val execution_context: ExecutionContextExecutor =
    1.17 +    ExecutionContext.fromExecutorService(Simple_Thread.default_pool)
    1.18 +
    1.19    def value[A](x: A): Future[A] = new Finished_Future(x)
    1.20 -  def fork[A](body: => A): Future[A] = new Pending_Future(Scala_Future[A](body))
    1.21 -  def promise[A]: Promise[A] = new Promise_Future[A](Scala_Promise[A])
    1.22 +
    1.23 +  def fork[A](body: => A): Future[A] =
    1.24 +    new Pending_Future(Scala_Future[A](body)(execution_context))
    1.25 +
    1.26 +  def promise[A]: Promise[A] =
    1.27 +    new Promise_Future[A](Scala_Promise[A])
    1.28  }
    1.29  
    1.30  trait Future[A]
    1.31 @@ -62,7 +69,8 @@
    1.32    override def is_finished: Boolean = future.isCompleted
    1.33  
    1.34    def join: A = Await.result(future, Duration.Inf)
    1.35 -  override def map[B](f: A => B): Future[B] = new Pending_Future[B](future.map(f))
    1.36 +  override def map[B](f: A => B): Future[B] =
    1.37 +    new Pending_Future[B](future.map(f)(Future.execution_context))
    1.38  }
    1.39  
    1.40  private class Promise_Future[A](promise: Scala_Promise[A])
     2.1 --- a/src/Tools/jEdit/etc/settings	Fri Apr 25 21:31:39 2014 +0200
     2.2 +++ b/src/Tools/jEdit/etc/settings	Fri Apr 25 22:10:03 2014 +0200
     2.3 @@ -4,9 +4,9 @@
     2.4  JEDIT_SETTINGS="$ISABELLE_HOME_USER/jedit"
     2.5  
     2.6  JEDIT_OPTIONS="-reuseview -noserver -nobackground -log=9"
     2.7 -#JEDIT_JAVA_OPTIONS="-Xms128m -Xmx512m -Xss1m -Dscala.concurrent.context.minThreads=1 -Dscala.concurrent.context.numThreads=x0.5 -Dscala.concurrent.context.maxThreads=8"
     2.8 -JEDIT_JAVA_OPTIONS="-Xms128m -Xmx1024m -Xss2m -Dscala.concurrent.context.minThreads=1 -Dscala.concurrent.context.numThreads=x0.5 -Dscala.concurrent.context.maxThreads=8"
     2.9 -#JEDIT_JAVA_OPTIONS="-Xms512m -Xmx4096m -Xss8m -Dscala.concurrent.context.minThreads=1 -Dscala.concurrent.context.numThreads=x0.5 -Dscala.concurrent.context.maxThreads=8"
    2.10 +#JEDIT_JAVA_OPTIONS="-Xms128m -Xmx512m -Xss1m"
    2.11 +JEDIT_JAVA_OPTIONS="-Xms128m -Xmx1024m -Xss2m"
    2.12 +#JEDIT_JAVA_OPTIONS="-Xms512m -Xmx4096m -Xss8m"
    2.13  JEDIT_SYSTEM_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dapple.laf.useScreenMenuBar=true -Dapple.awt.application.name=Isabelle -Dscala.repl.no-threads=true"
    2.14  
    2.15  ISABELLE_JEDIT_OPTIONS=""