Starting multiple tasks and then waiting for them all to finish is "fork-join parallelism", and can be written in F# using Async.Parallel. The code would be something like

1
2
3
4
5
let tasks = [
    async { return doTaskA("Hello") }
    async { return doTaskB("Fine") }
    ]
tasks |> Async.Parallel |> Async.RunSynchronously

See

[link:msdn.microsoft.com]

[link:blogs.msdn.com]

or most any example you can find that uses "Async.Parallel" for examples.

By on 3/28/2010 2:07 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper