Re: Threads and memory management

2009-04-25 Thread j.waldmann

Here is some more data. It seems the behaviour depends on 32/64 bit arch?

###

waldm...@master:~/tmp$ uname -a
Linux master 2.6.18-6-amd64 #1 SMP Fri Dec 12 05:49:32 UTC 2008 x86_64
GNU/Linux

waldm...@master:~/tmp$ time ./Par +RTS -N1
496165411
496165411

real0m22.580s
user0m22.541s
sys 0m0.040s
waldm...@master:~/tmp$ time ./Par +RTS -N2
496165411
496165411

real0m21.259s
user0m26.678s
sys 0m0.164s



waldm...@box:~/tmp uname -a
Linux box 2.6.27.21-0.1-pae #1 SMP 2009-03-31 14:50:44 +0200 i686 i686 i386
GNU/Linux

waldm...@box:~/tmp time ./Par +RTS -N1
496165411
496165411

real0m29.802s
user0m29.670s
sys 0m0.028s
waldm...@box:~/tmp time ./Par +RTS -N2
496165411
496165411

real0m11.219s
user0m14.917s
sys 0m0.164s

###

I don't understand this. The fun thing is that the first machine is 
Intel(R) Xeon(R) CPU   X5365  @ 3.00GHz
while the second is a much cheaper
model name  : Genuine Intel(R) CPU   T2050  @ 1.60GHz


-- 
View this message in context: 
http://www.nabble.com/Threads-and-memory-management-tp23221239p23231596.html
Sent from the Haskell - Glasgow-haskell-users mailing list archive at 
Nabble.com.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Advice wanted on parallel processing

2009-03-18 Thread j.waldmann



 (I am not updating in place).
 The move generator produces a new board for each move.

Well, this is sound design, but current memory managers may not be up to it. 
If you check the (board) game programming literature, 
you'll find that engine authors take great efforts to bypass automatic
memory management  
(do all updates on the current board in-place, and write their own
malloc/free for game tree nodes).

This becomes even more important when trying to exploit concurrency.
In theory, that's all very nice (you can evaluate independent branches of
the game tree
in parallel) but in practice, you're doomed if your memory
allocator/collector 
is  still essentially single-threaded (that is, blocks all threads).

That's language independent (it's a property of the run-time system).
Of course in a more declarative language it should be easier for the
compiler 
to analyze the source code and replace malloc/free by something better
(no allocation by immediate re-use, or easy deallocation by some stack
regime).

J.W.

-- 
View this message in context: 
http://www.nabble.com/Advice-wanted-on-parallel-processing-tp22580444p22591720.html
Sent from the Haskell - Glasgow-haskell-users mailing list archive at 
Nabble.com.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users