jlezard
jlezard

Reputation: 1437

Async.Parallel, grouping work of many works

Is a pattern like:

seq[ workSeq, workSeq ..., workSeq, workSeq]
|> Seq.map( Async.Parallel )
|> Async.Parallel
|> Async.RunSynchronously

ok?, Or do i have to do:

seq[ workSeq, workSeq ..., workSeq, workSeq]
|> Seq.concat
|> Async.Parallel
|> Async.RunSynchronously

How do these two options behave differently ?

Thanks

Upvotes: 0

Views: 191

Answers (1)

Brian
Brian

Reputation: 118865

One does a single fork-join among all the tiny pieces of work, whereas the other does a fork-join over a group of other fork-join batches. Which behavior do you intend? The former seems more likely to be useful to me... So I would probably do the concat.

Upvotes: 1

Related Questions