just one default thread pool (which is hardwired to Runtime.availableProcessors);
--- a/src/Pure/Concurrent/future.scala Fri Apr 25 21:31:39 2014 +0200
+++ b/src/Pure/Concurrent/future.scala Fri Apr 25 22:10:03 2014 +0200
@@ -10,16 +10,23 @@
import scala.util.{Success, Failure}
-import scala.concurrent.{Future => Scala_Future, Promise => Scala_Promise, Await}
+import scala.concurrent.{ExecutionContext, ExecutionContextExecutor,
+ Future => Scala_Future, Promise => Scala_Promise, Await}
import scala.concurrent.duration.Duration
-import scala.concurrent.ExecutionContext.Implicits.global
object Future
{
+ lazy val execution_context: ExecutionContextExecutor =
+ ExecutionContext.fromExecutorService(Simple_Thread.default_pool)
+
def value[A](x: A): Future[A] = new Finished_Future(x)
- def fork[A](body: => A): Future[A] = new Pending_Future(Scala_Future[A](body))
- def promise[A]: Promise[A] = new Promise_Future[A](Scala_Promise[A])
+
+ def fork[A](body: => A): Future[A] =
+ new Pending_Future(Scala_Future[A](body)(execution_context))
+
+ def promise[A]: Promise[A] =
+ new Promise_Future[A](Scala_Promise[A])
}
trait Future[A]
@@ -62,7 +69,8 @@
override def is_finished: Boolean = future.isCompleted
def join: A = Await.result(future, Duration.Inf)
- override def map[B](f: A => B): Future[B] = new Pending_Future[B](future.map(f))
+ override def map[B](f: A => B): Future[B] =
+ new Pending_Future[B](future.map(f)(Future.execution_context))
}
private class Promise_Future[A](promise: Scala_Promise[A])
--- a/src/Tools/jEdit/etc/settings Fri Apr 25 21:31:39 2014 +0200
+++ b/src/Tools/jEdit/etc/settings Fri Apr 25 22:10:03 2014 +0200
@@ -4,9 +4,9 @@
JEDIT_SETTINGS="$ISABELLE_HOME_USER/jedit"
JEDIT_OPTIONS="-reuseview -noserver -nobackground -log=9"
-#JEDIT_JAVA_OPTIONS="-Xms128m -Xmx512m -Xss1m -Dscala.concurrent.context.minThreads=1 -Dscala.concurrent.context.numThreads=x0.5 -Dscala.concurrent.context.maxThreads=8"
-JEDIT_JAVA_OPTIONS="-Xms128m -Xmx1024m -Xss2m -Dscala.concurrent.context.minThreads=1 -Dscala.concurrent.context.numThreads=x0.5 -Dscala.concurrent.context.maxThreads=8"
-#JEDIT_JAVA_OPTIONS="-Xms512m -Xmx4096m -Xss8m -Dscala.concurrent.context.minThreads=1 -Dscala.concurrent.context.numThreads=x0.5 -Dscala.concurrent.context.maxThreads=8"
+#JEDIT_JAVA_OPTIONS="-Xms128m -Xmx512m -Xss1m"
+JEDIT_JAVA_OPTIONS="-Xms128m -Xmx1024m -Xss2m"
+#JEDIT_JAVA_OPTIONS="-Xms512m -Xmx4096m -Xss8m"
JEDIT_SYSTEM_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dapple.laf.useScreenMenuBar=true -Dapple.awt.application.name=Isabelle -Dscala.repl.no-threads=true"
ISABELLE_JEDIT_OPTIONS=""