diff options
author | Philipp Haller <hallerp@gmail.com> | 2008-12-18 10:21:53 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2008-12-18 10:21:53 +0000 |
commit | c26147bf68eecaf994c233193b141f71e80baa3e (patch) | |
tree | 8b09f6624d7803185deb70c433ca48aaaf10c5ab | |
parent | 60662ceb78143503d50042453676c5c1b41bfc43 (diff) | |
download | scala-c26147bf68eecaf994c233193b141f71e80baa3e.tar.gz scala-c26147bf68eecaf994c233193b141f71e80baa3e.tar.bz2 scala-c26147bf68eecaf994c233193b141f71e80baa3e.zip |
Made timestamp optimization configurable.
-rw-r--r-- | src/actors/scala/actors/FJTaskScheduler2.scala | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/actors/scala/actors/FJTaskScheduler2.scala b/src/actors/scala/actors/FJTaskScheduler2.scala index 24a2f119d5..943f796572 100644 --- a/src/actors/scala/actors/FJTaskScheduler2.scala +++ b/src/actors/scala/actors/FJTaskScheduler2.scala @@ -45,6 +45,13 @@ class FJTaskScheduler2 extends Thread with IScheduler { case ace: java.security.AccessControlException => null } + val timeFreqProp = + try { + System.getProperty("actors.timeFreq") + } catch { + case ace: java.security.AccessControlException => + null + } val initCoreSize = if (null ne coreProp) Integer.parseInt(coreProp) @@ -60,6 +67,10 @@ class FJTaskScheduler2 extends Thread with IScheduler { if (null ne maxProp) Integer.parseInt(maxProp) else 256 + val timeFreq = + if (null ne timeFreqProp) Integer.parseInt(timeFreqProp) + else 10 + private var coreSize = initCoreSize private val executor = @@ -155,7 +166,7 @@ class FJTaskScheduler2 extends Thread with IScheduler { * @param a the actor */ def tick(a: Actor) = synchronized { - if (tickCnt == 100) { + if (tickCnt == timeFreq) { tickCnt = 0 lastActivity = Platform.currentTime } else |