Introducing concurrency support in F# 4
It is important to have concurrency support from the programming language perspective, especially as built-in language features. In F#, concurrency support in F# was available before F# 4.0. Two of the concurrency features: the asynchronous workflow and MailboxProcessor
have been available since F# 1.9.
In a quick overview, F# has the following concurrency features:
Asynchronous workflow
Asynchronous message passing using actor model and an F# special class that functions as an agent for message passing,
MailboxProcessor
Parallel programming support for asynchronous workflow
Interop with .NET Task Parallel Library (TPL)
Asynchronous workflow is actually an implementation of a computation expression that is escalated as syntactic sugar. It is escalated within a block of asynchronous code that has calls to asynchronous functions, marked in the beginning with async
as keyword.
From the perspective of conceptual concurrency, it is quite intuitive and easier...