3 ms·
Are you sure Racket doesn't support parallelism?
by threatofrain 8y ago
Are you sure Racket doesn't support parallelism?
- klibertp 8y agoIt does, in at least two different ways: 1. via `places` - basically spawning a new OS-level process and communicating with it. Has an advantage of being able to talk to processes on other machines. 2. via `futures` - OS-level threads, which insert synchronization points automatically where necessary. You have to structure your code in a particular way to make them not to sync, at which point you get a safe parallelism within a process. You get a future visualizer which helps in finding unsafe (syncing) memory accesses. So the support for parallelism may be nowhere near Erlang or Pony, a bit worse than Java and a bit better than Python or Ruby.
- mjs2600 8y agoIt definitely seems like it does https://docs.racket-lang.org/guide/parallelism.html https://docs.racket-lang.org/guide/parallelism.html
- jonathanstrange 8y agoRacket's support for parallelism with futures and places is in my experience almost unusable. I don't understand why they have chosen these horrible abstractions rather than providing access to OS-level threads plus some reasonable synchronization mechanisms like channels, shared memory, or actors. Before you criticize me for this statement, please let me assure you that it's based on plenty of experience. I'm using Racket for almost all my programming since Racket 2 and have contributed libraries. My hope is that they add good parallelism support in Racket 7, and since it's based on Chez scheme all thread support should already be built in. Places suck.