Re: [Haskell-cafe] Parallel + exceptions

2007-06-25 Thread Andrew Coppin

Sebastian Sylvan wrote:

On 25/06/07, Andrew Coppin <[EMAIL PROTECTED]> wrote:

Does anybody know where I can find a version of this paper that actually
has the diagrams in it?



http://citeseer.ist.psu.edu/cache/papers/cs/8487/http:zSzzSzwww.cee.hw.ac.ukzSz~dsgzSzgphzSzpaperszSzabstractszSz..zSzpszSzstrategies.pdf/trinder98algorithm.pdf 


Thanks! :-)

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Parallel + exceptions

2007-06-25 Thread Andrew Coppin

Andrew Coppin wrote:

Felipe Almeida Lessa wrote:

Have you seen this paper?
http://www.macs.hw.ac.uk/~dsg/gph/papers/html/Strategies/strategies.html

It's probably want you want, I think.



Well, it certainly looks interesting... thanks.


Does anybody know where I can find a version of this paper that actually 
has the diagrams in it?


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Parallel + exceptions

2007-06-25 Thread Andrew Coppin

Felipe Almeida Lessa wrote:

On 6/23/07, Andrew Coppin <[EMAIL PROTECTED]> wrote:

It's nice that you can have millions of threads if you want to do
something very "concurrent". What I tend to want is "parallel" - doing
stuff that *could* be done in a single thread, but I want it to go
faster using my big mighty multicore box. As I understand it, you have
to do something "special" to make that happen...?


Have you seen this paper?
http://www.macs.hw.ac.uk/~dsg/gph/papers/html/Strategies/strategies.html

It's probably want you want, I think.



Well, it certainly looks interesting... thanks.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Parallel + exceptions

2007-06-24 Thread Donald Bruce Stewart
andrewcoppin:
> Bulat Ziganshin wrote:
> >Hello Andrew,
> >
> >  
> >definitive reading: "Tackling the awkward squad: monadic input/output,
> >concurrency, exceptions, and foreign-language calls in Haskell"
> >http://research.microsoft.com/Users/simonpj/papers/marktoberdorf/marktoberdorf.ps.gz
> >  
> 
> I've read it.
> 
> Is everything described in that paper actually implemented now? (And 
> implemented in exactly the same way as the paper says?)
> 
> >in my experience, exceptions are rarely required in Haskell program -
> >i use them only to roll out when IO problems occur.
> 
> Indeed. Somebody else mentioned Maybe; much cleaner, more intuitive 
> solution.
> 
> >OTOH, concurrency
> >is very handy in Haskell/GHC - it's easy to create threads and
> >communicate in reliable way, so it's a great tool to split algorithm
> >into subtasks. and GHC lightweight threads make it very cheap - you
> >may run thousands of threads. example program that uses one thread to
> >produce numbers and another to print them is less than 10 lines long
> >  
> 
> It's nice that you can have millions of threads if you want to do 
> something very "concurrent". What I tend to want is "parallel" - doing 
> stuff that *could* be done in a single thread, but I want it to go 
> faster using my big mighty multicore box. As I understand it, you have 
> to do something "special" to make that happen...?
> 
> While we're on the subject... has anybody ever looked at using muptiple 
> processors on *networked* machines? Haskell's very pure semantics would 
> seem quite well-suited to this...
> 

MPI/cluster stuff has also been done a fair bit, but in these days SMP
multicore machines are a hot topic. Start here:


http://haskell.org/haskellwiki/Applications_and_libraries/Concurrency_and_parallelism

P.S. An awful lot of your questions are previously answered on the wiki :-)
It's a good resource!

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Parallel + exceptions

2007-06-23 Thread Felipe Almeida Lessa

On 6/23/07, Andrew Coppin <[EMAIL PROTECTED]> wrote:

It's nice that you can have millions of threads if you want to do
something very "concurrent". What I tend to want is "parallel" - doing
stuff that *could* be done in a single thread, but I want it to go
faster using my big mighty multicore box. As I understand it, you have
to do something "special" to make that happen...?


Have you seen this paper?
http://www.macs.hw.ac.uk/~dsg/gph/papers/html/Strategies/strategies.html

It's probably want you want, I think.

--
Felipe.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[2]: [Haskell-cafe] Parallel + exceptions

2007-06-23 Thread Bulat Ziganshin
Hello Andrew,

Saturday, June 23, 2007, 7:12:52 PM, you wrote:

> Is everything described in that paper actually implemented now? (And
> implemented in exactly the same way as the paper says?)

difference may be in subtle details. it just works for me :)

>> in my experience, exceptions are rarely required in Haskell program -
>> i use them only to roll out when IO problems occur.

> Indeed. Somebody else mentioned Maybe; much cleaner, more intuitive 
> solution.

for me Maybe works great for exclusion of failed items (file not
found, etc) while exceptions are used to transfer control over the
many calling levels when we need to abort large piece of computation
entirely

> It's nice that you can have millions of threads if you want to do
> something very "concurrent". What I tend to want is "parallel" - doing
> stuff that *could* be done in a single thread, but I want it to go 
> faster using my big mighty multicore box.

this isn't completely different things. threads' easy of use means
that you can split your algorithm into parallel tasks here and there,
improving CPU utilization

> As I understand it, you have
> to do something "special" to make that happen...?

my own program spend most of its time in C threads, so i can't make
exact answer to your query. afair, you need to use -threaded when
compiling program, "+RTS -N2" for 2-core box when you run it - that's
all. ask me if you need C threads too

> While we're on the subject... has anybody ever looked at using muptiple
> processors on *networked* machines? Haskell's very pure semantics would
> seem quite well-suited to this...

i'm not sure, but this may be what you are looking for:
http://f.loulergue.free.fr/ftp/bsmllib-0.25.tar.gz
http://f.loulergue.free.fr/ftp/bsmllib-0.25_manual_html.tar.gz
http://www.inf.ufes.br/~ffranzosi/BSPHlib-0.1.tar.gz
http://f.loulergue.free.fr/ftp/minibsml-0.11.tar.gz

-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Parallel + exceptions

2007-06-23 Thread Andrew Coppin

Bulat Ziganshin wrote:

Hello Andrew,

  
definitive reading: "Tackling the awkward squad: monadic input/output,

concurrency, exceptions, and foreign-language calls in Haskell"
http://research.microsoft.com/Users/simonpj/papers/marktoberdorf/marktoberdorf.ps.gz
  


I've read it.

Is everything described in that paper actually implemented now? (And 
implemented in exactly the same way as the paper says?)



in my experience, exceptions are rarely required in Haskell program -
i use them only to roll out when IO problems occur.


Indeed. Somebody else mentioned Maybe; much cleaner, more intuitive 
solution.



OTOH, concurrency
is very handy in Haskell/GHC - it's easy to create threads and
communicate in reliable way, so it's a great tool to split algorithm
into subtasks. and GHC lightweight threads make it very cheap - you
may run thousands of threads. example program that uses one thread to
produce numbers and another to print them is less than 10 lines long
  


It's nice that you can have millions of threads if you want to do 
something very "concurrent". What I tend to want is "parallel" - doing 
stuff that *could* be done in a single thread, but I want it to go 
faster using my big mighty multicore box. As I understand it, you have 
to do something "special" to make that happen...?


While we're on the subject... has anybody ever looked at using muptiple 
processors on *networked* machines? Haskell's very pure semantics would 
seem quite well-suited to this...


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Parallel + exceptions

2007-06-23 Thread Bulat Ziganshin
Hello Andrew,

Saturday, June 23, 2007, 5:59:45 PM, you wrote:

> The two things mentioned in the subject line are both things I've never
> tried with Haskell. I've seen a lot of papers about these things, but I
> don't really understand what the current state of play with this is. Are
> any of these things "production-ready" yet? And how do you use them in
> the real world?

definitive reading: "Tackling the awkward squad: monadic input/output,
concurrency, exceptions, and foreign-language calls in Haskell"
http://research.microsoft.com/Users/simonpj/papers/marktoberdorf/marktoberdorf.ps.gz

my program uses both, together with ^Break handling, and ~10 C++ and
Haskell threads running in parallel

in my experience, exceptions are rarely required in Haskell program -
i use them only to roll out when IO problems occur. OTOH, concurrency
is very handy in Haskell/GHC - it's easy to create threads and
communicate in reliable way, so it's a great tool to split algorithm
into subtasks. and GHC lightweight threads make it very cheap - you
may run thousands of threads. example program that uses one thread to
produce numbers and another to print them is less than 10 lines long

-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Parallel + exceptions

2007-06-23 Thread Neil Mitchell

Hi

Parallel: I think this is pretty well solved with STM. I think STM is
production ready in GHC.

Exceptions: These are less well solved, people are still thinking
about some of the issues. In general, you probably don't want to use
exceptions too much - the Maybe Monad is often a better choice.

Thanks

Neil

On 6/23/07, Andrew Coppin <[EMAIL PROTECTED]> wrote:

The two things mentioned in the subject line are both things I've never
tried with Haskell. I've seen a lot of papers about these things, but I
don't really understand what the current state of play with this is. Are
any of these things "production-ready" yet? And how do you use them in
the real world?

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Parallel + exceptions

2007-06-23 Thread Andrew Coppin
The two things mentioned in the subject line are both things I've never 
tried with Haskell. I've seen a lot of papers about these things, but I 
don't really understand what the current state of play with this is. Are 
any of these things "production-ready" yet? And how do you use them in 
the real world?


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe