Revised newer sections

This commit is contained in:
Justin Ethier 2019-07-12 17:05:39 -04:00
parent c51fb226ce
commit f7717d25ab

View file

@ -200,11 +200,11 @@ Based on the procedure of the same name from Clojure.
## Delays ## Delays
A delay is created to execute code at a later time. When the result is required any thread can call `deref` to generate it. Once executed the result is cached so it is available for other threads. A delay stores code that will not be executed until dereferenced via `deref`. The result is then cached.
Delays are based on delay objects from Clojure. Delays are based on delay objects from Clojure.
Note delays are referred to as `shared-delay` in the code to differentiate them from the single-threaded `delay` provided by `(scheme lazy)`. Note delays are referred to as `shared-delay` to differentiate them from the single-threaded `delay` provided by `(scheme lazy)`.
### shared-delay? ### shared-delay?
@ -228,11 +228,11 @@ Create a delay object that will execute `thunk` when dereferenced.
## Promises ## Promises
A promise allows one or more threads to wait for a value to be generated by another thread. When `deref` is called on a promise the calling thread will block until a value is delivered to the promise, via another thread calling `deliver`. A promise allows one or more threads to wait for a value to be generated by another thread. When `deref` is called on a promise the calling thread blocks until a value is delivered to the promise, via another thread calling `deliver`.
Promises are based off of promise objects from Clojure. Promises are based off of promise objects from Clojure.
Note promises are referred to as `shared-promise` in the code to differentiate them from the single-threaded promise functionality provided by `(scheme lazy)`. Note promises are referred to as `shared-promise` to differentiate them from the single-threaded functionality provided by `(scheme lazy)`.
### shared-promise? ### shared-promise?