
Can you mutate different parts of the same array from different threads in parallel using GHC? Someone once told me this was possible but I cannot see how... -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e

Am Dienstag 08 Dezember 2009 21:56:45 schrieb Jon Harrop:
Can you mutate different parts of the same array from different threads in parallel using GHC? Someone once told me this was possible but I cannot see how... You can (take a look at Control.Concurrent), but very probably ***You really shouldn't***, so I won't elaborate.
What would you want to do that for?

On Tuesday 08 December 2009 21:37:41 Daniel Fischer wrote:
Am Dienstag 08 Dezember 2009 21:56:45 schrieb Jon Harrop:
Can you mutate different parts of the same array from different threads in parallel using GHC? Someone once told me this was possible but I cannot see how...
You can (take a look at Control.Concurrent), but very probably ***You really shouldn't***, so I won't elaborate.
What would you want to do that for?
Efficiency, e.g. parallel quicksort. -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e

Jon Harrop wrote:
On Tuesday 08 December 2009 21:37:41 Daniel Fischer wrote:
Am Dienstag 08 Dezember 2009 21:56:45 schrieb Jon Harrop:
Can you mutate different parts of the same array from different threads in parallel using GHC? Someone once told me this was possible but I cannot see how...
You can (take a look at Control.Concurrent), but very probably ***You really shouldn't***, so I won't elaborate.
What would you want to do that for?
Efficiency, e.g. parallel quicksort.
So why not look at Data Parallel Haskell: http://www.haskell.org/haskellwiki/GHC/Data_Parallel_Haskell Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/

Erik de Castro Lopo wrote:
So why not look at Data Parallel Haskell:
http://www.haskell.org/haskellwiki/GHC/Data_Parallel_Haskell
Quicksort example: http://darcs.haskell.org/ghc-6.10/packages/dph/examples/qsort/ I haven't tested this. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/

On Thursday 10 December 2009 01:00:55 Erik de Castro Lopo wrote:
Erik de Castro Lopo wrote:
So why not look at Data Parallel Haskell:
http://www.haskell.org/haskellwiki/GHC/Data_Parallel_Haskell
Quicksort example:
http://darcs.haskell.org/ghc-6.10/packages/dph/examples/qsort/
I haven't tested this.
It isn't even a real quicksort => it will be orders of magnitude slower than a real quicksort. -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e
participants (3)
-
Daniel Fischer
-
Erik de Castro Lopo
-
Jon Harrop