Erlang promises concurrency in F #

Mr. Joe Armstrong says that with Erlang we could have sequential code that runs N times faster with N cores. Does this also apply to F #? Or is Erlang VM designed this way? Does F # control processes in the OS or in the language?

+4
source share
2 answers

The MailboxProcessor type in F # (see MSDN docs ) implements essentially the same concurrency agent model as Erlang. The only difference is that Erlang is more suitable for distributed computing (on multiple computers), and F # uses a programming model mainly on one machine (but multiple threads / cores).

In general, I think Erlang claims will also apply to F #.

As for the quote : I'm not quite sure what the author is trying to say for sure (maybe some context is missing?). This, of course, does not mean that you can use a regular (sequential) program and run it magically N times faster.

However, if you use the Erlang programming model or the F # agnet-based concurrency, you can get acceleration with each additional core. This means that you will write the program as a large number of agents (instances of MailboxProcessor in F #). Individual agents are written as sequential routines, but you still need to think differently about programming.

Technical aspects . Erlang does not use physical OS threads and does not do F #, so the behavior should be approximately the same. This means that you can create a large number of agents (which is the point of the programming model). Agents in F # are based on asynchronous workflows that make this possible.

+10
source

Adding kernels will only improve the speed of your application, if it is enough to use them, see Amdahl Law . Using Erlang correctly simplifies the collection of applications in this way, since concurrency is simple and cheap.

+1
source

All Articles