diff options
author | Eduardo Julian | 2018-05-08 22:30:03 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-05-08 22:30:03 -0400 |
commit | 8c90251c12a4d0d4cc191bfb273bb5eb51bb0356 (patch) | |
tree | 5964bba6bedd134c244bc322df4cced3419ca957 /new-luxc/source/luxc/lang/translation/scheme/runtime.jvm.lux | |
parent | ca9541c0c10d4e6aa94055ecfb47301ed7292828 (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 '')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/scheme/runtime.jvm.lux | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/new-luxc/source/luxc/lang/translation/scheme/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/scheme/runtime.jvm.lux index c4cd0a909..3bdfc614f 100644 --- a/new-luxc/source/luxc/lang/translation/scheme/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/scheme/runtime.jvm.lux @@ -327,25 +327,27 @@ (@@ queue))) (process//loop ..unit))))))) -(runtime: (process//future procedure) - (_.begin (list (_.set! process//incoming (_.cons (@@ procedure) (@@ process//incoming))) - ..unit))) - (runtime: (process//schedule milli-seconds procedure) - (with-vars [start process now _ignored] - (_.let (list [start (io//current-time ..unit)]) - (_.letrec (list [process (_.lambda _ignored - (_.let (list [now (io//current-time ..unit)]) - (_.if (|> (@@ now) (_.- (@@ start)) (_.>= (@@ milli-seconds))) - (_.apply (@@ procedure) (list ..unit)) - (process//future (@@ process)))))]) - (process//future (@@ process)))))) + (let [process//future (function (_ process) + (_.set! process//incoming (_.cons process (@@ process//incoming))))] + (_.begin + (list + (_.if (_.= (_.int 0) (@@ milli-seconds)) + (process//future (@@ procedure)) + (with-vars [start process now _ignored] + (_.let (list [start (io//current-time ..unit)]) + (_.letrec (list [process (_.lambda _ignored + (_.let (list [now (io//current-time ..unit)]) + (_.if (|> (@@ now) (_.- (@@ start)) (_.>= (@@ milli-seconds))) + (_.apply (@@ procedure) (list ..unit)) + (process//future (@@ process)))))]) + (process//future (@@ process)))))) + ..unit)))) (def: runtime//process Runtime (_.begin (list (_.define process//incoming (list) (_.list (list))) @@process//loop - @@process//future @@process//schedule))) (def: runtime |