Parallel Threads in Racket v9.0
blog.racket-lang.org·1h·
Discuss: Hacker News
Flag this post

posted by Matthew Flatt, Ryan Culpepper, Robby Findler, Gustavo Massaccesi, and Sam Tobin-Hochstadt

With the version 9.0 release, Racket includes support for shared-memory threads that can take advantage of multicore hardware and operating-systems threads to run in parallel— not merely concurrently with other Racket threads, as was the case in versions before 9.0.

Creating a thread that runs in parallel is as simple as adding a flag to the call to thread. To see the effect, try first putting the following code into a file named “thread.rkt” and running racket thread.rkt on the command line:

Racket will find many square roots (tweak N to match your machine), but will keep onl…

Similar Posts

Loading similar posts...