[Haskell-cafe] Parallel programming in Haskell (threads, cores,
valheru at chariot.net.au
Tue Mar 10 22:08:55 EDT 2009
Im an experienced software developer, but a bit of a newbie when it comes
to parallel processing in any language.
Ive done some multithreading in Java and C++ on a single processor, single
core architecture only.
First, let me define some terms:
Multithreading: this is multiple processes running on one processor and is
the conventional way to do parallel programming
Multicore: this is when we have two (or more) cores within the one CPU
Multiprocessor: this is when we have multiple CPUs
Is there any programmatic change in dealing with multiple threads as opposed
to multiple cores in most languages (specifically Haskell)?
That is, to write multiple threads you normally spin-off a new thread
which runs in parallel along with other threads. Is Haskell smart enough to
do this by magic by itself, or would I need to tell it explicitly : Run
thread A whilst running thread B
Also, what about multicore architectures? Do I have to tell the language to
spin off two separate programs to run on each core and then somehow use some
kind of communications to exchange data?
I also assume that, in theory it would be possible to have multiple threads
running on each core. Say, 3 threads spawned from program 1 running on core
1 and 5 threads on program 2 running on core 2
Likewise I would suppose that it would be possible to have multiprocessors,
each potentially multicore, each core running multiple threads.
In light of the above statement, is the programmatic change DIFFERENT for
dealing with each of
a) Multithreading in Haskell versus
b) Multicores in Haskell verus
c) Multiprocessors in Haskell
References or info appreciated.
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.557 / Virus Database: 270.11.9/1993 - Release Date: 10/03/2009
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe