News for hackers. Stuff that matters.
Re:Rich Hickey: Reducers - A Library And Model For Collectio... by rickmode on Tuesday May 08, 2012 @02:12PM (#3945061)
Is there no need to tune the number of threads with an approach like this? Or is there a general notion of the appropriate number of threads given the number of CPU cores?
Re:Rich Hickey: Reducers - A Library And Model For Collectio... by weavejester on Tuesday May 08, 2012 @02:22PM (#3945121)
If you're not doing any I/O, the number of threads can be limited to the number of cores. I believe this is the default for Fork/Join.
Re:Rich Hickey: Reducers - A Library And Model For Collectio... by puredanger on Tuesday May 08, 2012 @02:38PM (#3945211)
Correct. ForkJoinPool defaults to Runtime.getRuntime().availableProcessors() threads (but can be adjusted). The reducers library (https://github.com/clojure/clojure/commit/89e5dce0fdfec4bc09...) seems to initialize the pool with the default constructor.
Re:Rich Hickey: Reducers - A Library And Model For Collectio... by drcode on Tuesday May 08, 2012 @02:16PM (#3945082)
I believe the Java fork/join library handles this tuning automatically... so it's a freebie based on Rich Hickey's design.