| Good Morning all, I was wondering how to get Racket Parallelism into Anarki to experiment with Data Oriented Design and Entity Component Systems. Please find below the link to racket/future and code. http://docs.racket-lang.org/reference/futures.html?q=parallelism ($:require racket/future)
(mac future (thunk) `($:future ,thunk))
(mac touch (f) `($:touch ,f))
(mac futures-enabled? () `($:futures-enabled?))
(mac current-future () `($:current-future))
(mac future? (v) `($:future? ,v))
(mac would-be-future (thunk) `($:would-be-future ,thunk))
(mac processor-count () `($:processor-count))
(mac fsemaphore? (v) `($:fsemaphore ,v))
(mac fsemaphore-post (fsema) `($:fsemaphore-post ,fsema))
(mac fsemaphore-wait (fsema) `($:fsemaphore-wait ,fsema))
(mac fsemaphore-try-wait? (fsema) `($:fsemaphore-try-wait? ,fsema))
($:define-syntax-rule (fn args . body)
(lambda args . body))
($:define-syntax-rule (prn body)
(printf body))
(let f (future (fn () (+ 1 2)))
(list (+ 3 4) (touch f)))
(touch (future (fn ()
(prn "hello1")
(prn "hello2")
(prn "hello3"))))
As for the Racket struct future-event I am not sure what to do about it
(struct future-event (future-id proc-id action time prim-name user-data) #:prefab)
|