aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/jvm
diff options
context:
space:
mode:
authorEduardo Julian2018-05-08 22:30:03 -0400
committerEduardo Julian2018-05-08 22:30:03 -0400
commit8c90251c12a4d0d4cc191bfb273bb5eb51bb0356 (patch)
tree5964bba6bedd134c244bc322df4cced3419ca957 /new-luxc/source/luxc/lang/translation/jvm
parentca9541c0c10d4e6aa94055ecfb47301ed7292828 (diff)
- Re-named "lux process concurrency-level" to "lux process parallelism-level".
- Merged the functionality of "lux process future" into "lux process schedule".
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm')
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux11
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/runtime.jvm.lux9
2 files changed, 4 insertions, 16 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
index 95d243761..5cb4d52ec 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
@@ -535,18 +535,12 @@
unitI))
## [[Processes]]
-(def: (process//concurrency-level [])
+(def: (process//parallelism-level [])
Nullary
(|>> ($i.INVOKESTATIC "java.lang.Runtime" "getRuntime" ($t.method (list) (#.Some ($t.class "java.lang.Runtime" (list))) (list)) false)
($i.INVOKEVIRTUAL "java.lang.Runtime" "availableProcessors" ($t.method (list) (#.Some $t.int) (list)) false)
lux-intI))
-(def: (process//future procedureI)
- Unary
- (|>> procedureI ($i.CHECKCAST hostL.function-class)
- ($i.INVOKESTATIC hostL.runtime-class "future"
- ($t.method (list $Function) (#.Some $Object) (list)) false)))
-
(def: (process//schedule [millisecondsI procedureI])
Binary
(|>> millisecondsI ($i.unwrap #$.Long)
@@ -693,8 +687,7 @@
Bundle
(<| (prefix "process")
(|> (dict.new text.Hash<Text>)
- (install "concurrency-level" (nullary process//concurrency-level))
- (install "future" (unary process//future))
+ (install "parallelism-level" (nullary process//parallelism-level))
(install "schedule" (binary process//schedule))
)))
diff --git a/new-luxc/source/luxc/lang/translation/jvm/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/runtime.jvm.lux
index 300c0c353..456974ccd 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/runtime.jvm.lux
@@ -387,20 +387,15 @@
($i.INVOKESPECIAL "java.lang.Thread" "<init>" ($t.method (list $Runnable) #.None (list)) false))))]
(|>> ($d.field #$.Public ($.++F $.finalF $.staticF) executor-field executorT)
($d.method #$.Public $.staticM "<clinit>" ($t.method (list) #.None (list))
- (let [concurrency-levelI (|>> ($i.INVOKESTATIC "java.lang.Runtime" "getRuntime" ($t.method (list) (#.Some $Runtime) (list)) false)
+ (let [parallelism-levelI (|>> ($i.INVOKESTATIC "java.lang.Runtime" "getRuntime" ($t.method (list) (#.Some $Runtime) (list)) false)
($i.INVOKEVIRTUAL "java.lang.Runtime" "availableProcessors" ($t.method (list) (#.Some $t.int) (list)) false))
executorI (|>> ($i.NEW executor-class)
$i.DUP
- concurrency-levelI
+ parallelism-levelI
($i.INVOKESPECIAL executor-class "<init>" ($t.method (list $t.int) #.None (list)) false))]
(|>> executorI
($i.PUTSTATIC hostL.runtime-class executor-field executorT)
$i.RETURN)))
- ($d.method #$.Public $.staticM "future"
- ($t.method (list $Function) (#.Some $Object) (list))
- (|>> (threadI (runnableI ($i.ALOAD +0)))
- ($i.INVOKEVIRTUAL "java.lang.Thread" "start" ($t.method (list) #.None (list)) false)
- endI))
($d.method #$.Public $.staticM "schedule"
($t.method (list $t.long $Function) (#.Some $Object) (list))
(let [delayI ($i.LLOAD +0)