3 ms·
Yes, Racket support using multiple cores/OS threads. There are two mechanisms -- shared memory parallelism that is limited in what operations the threads can ex
by samth 7y ago
Yes, Racket support using multiple cores/OS threads. There are two mechanisms -- shared memory parallelism that is limited in what operations the threads can execute in parallel (called futures in Racket) and shared-nothing parallelism with message passing, more like Erlang (called places in Racket). Most real work using parallelism in Racket uses places.
- tombert 7y agoI guess I was confused by this [1], specifically: Racket supports multiple threads of evaluation. Threads run concurrently, in the sense that one thread can preempt another without its cooperation, but threads currently all run on the same processor (i.e., the same underlying operating system process and thread). Is this documentation out of date or am I looking in the wrong place? [1] https://docs.racket-lang.org/reference/eval-model.html#%28part._thread-model%29 https://docs.racket-lang.org/reference/eval-model.html#%28pa...
- neilv 7y agoHere's two places to start, for the various options (sorry it's two separate manuals): https://docs.racket-lang.org/guide/parallelism.html https://docs.racket-lang.org/guide/parallelism.html https://docs.racket-lang.org/reference/concurrency.html https://docs.racket-lang.org/reference/concurrency.html Of course, you can also do it the old-fashioned way, with multiple Racket processes running services, being workers behind a proxy/frontend, possibly on multiple hosts, etc.
- samth 7y agoThat's about the `thread` construct specifically, which as it says is green threads. Mostly people who are spreading work across multiple cores will have a few places that communicate, each of which has multiple threads to handle internal concurrency.
- tombert 7y agoFair enough! That's what I get for giving up after the first piece of documentation. Maybe I'll give Racket another try....