~subsetpark/bagatto

f2d0b8ea50833abc37283c0bfb33e662e594290c — Zach Smith 1 year, 2 days ago 9715c70
A little formatting
1 files changed, 7 insertions(+), 2 deletions(-)

M src/threads.janet
M src/threads.janet => src/threads.janet +7 -2
@@ 20,6 20,8 @@
    (while true
      (:send parent thread-id)
      (let [msg (thread/receive)]
        # `f` has to handle a `:die` message or this will never
        # terminate.
        (f msg)))))

(defn demand-pipeline


@@ 48,7 50,9 @@

  (each t pool (:send t :die)))

(defn- one-time-worker [f] (thread/new (fn [parent] (f parent)) 1 :h))
(defn- one-time-worker
  [f]
  (thread/new (fn [parent] (f parent)) 1 :h))

(defn distribute
  ```


@@ 61,7 65,8 @@
  Returns a mapping from `k` to `v`.
  ```
  [jobs]
  (let [workers (seq [job :in jobs] (one-time-worker job)) res @{}]
  (let [workers (seq [job :in jobs] (one-time-worker job))
        res @{}]
    (var got-back 0)
  
    (while (< got-back (length jobs))