On Nov 28, 2007 11:07 PM, Maurí­cio <[EMAIL PROTECTED]> wrote:

> Sorry, I don't agree. I try to write things in a
> way that when you read it you can get an intuition
> on why it's doing what it's doing; even when the

That's what comment are for :)

> generate. So, instead of checking if threads have
> finished, I decided to check if files exist and
> are available for writing. When I read 'takeMVar

Checking a file is non blocking, right ? So you have to loop until the
file becomes available.
taking a MVar, on the other hand, blocks your thread until the other
one finishes, without using cpu time, etc.

> know of a benchmark where the task is some kind of
> situation where you actually get a result faster
> by using threads than by using a single thread?

Threads won't give you a speedup unless you run the program on a
multi-core/multi-proc machine.
They help making the program simpler, IMHO.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to