Re: Multithreading didn't make my program as much faster as I expected...

2010-05-31 Thread Zak Wilson
Number of CPUs + 2 is what pmap uses, and I assumed the idea was to keep all the CPUs busy in the event that one finishes before the others. I wrote it before I did testing with npmap. Since reading your last post, I did a bit of testing with modified versions of zpmap and found that it isn't makin

Re: Multithreading didn't make my program as much faster as I expected...

2010-05-31 Thread Paul Moore
On 31 May 2010 06:12, Zak Wilson wrote: > The trouble with pmap is that it only works well with a slow function > and a short sequence. In trivial tests, it seems to be best if the > sequence has as many elements as you do cores. > > I've been experimenting with things that are like pmap, but work

Re: Multithreading didn't make my program as much faster as I expected...

2010-05-30 Thread Zak Wilson
The trouble with pmap is that it only works well with a slow function and a short sequence. In trivial tests, it seems to be best if the sequence has as many elements as you do cores. I've been experimenting with things that are like pmap, but work better in situations that I care about. I'm havin

Multithreading didn't make my program as much faster as I expected...

2010-05-30 Thread Paul Moore
I've written a small simulation program, in order to help me learn Clojure. I've reproduced it below. It's quite likely not very idiomatic - any suggestions on how to improve it would be nice. However, my main concern is that it doesn't seem to scale as I would expect when multi-threading. The sim