himekami
himekami

Reputation: 1459

How to do multi core programming in F#

How do I program I F# that utilize multi cores CPU? Say instead of multithread or async? In python language, they have multiprocessing module but what is the equivalent for F#?

Upvotes: 4

Views: 1947

Answers (3)

Grzegorz Sławecki
Grzegorz Sławecki

Reputation: 1797

If You're intereseted in GPU programming (which is strongly related to multicore, or even manycore) in F#, take a look into Alea GPU which allows You to easily use F# for technologies like CUDA.

For list other GPU programming options in F#, look here.

You can also try to employ the actor model. Akka.NET has some nice F# API.

There's also an incoming book that as a whole can be considered an answer to the question (didn't read it yet).

Upvotes: 0

Maxim Kitsenko
Maxim Kitsenko

Reputation: 2333

There are several approaches for parallelization in F#

  1. F# uses CLR and CTS so it is possible to use usual .NET constructions like you do it in C#. For example: Thread, BackgroundWorker, AutoResetEvent etc. Details
  2. F# has a built-in construct called "asynchronous workflows" Details
  3. There are some frameworks which allow you to choose appropriate parallelisation model. For example Hopac

Upvotes: 3

Anton Schwaighofer
Anton Schwaighofer

Reputation: 3149

Adding a couple of pointers to what has already been mentioned in the comments:

Upvotes: 0

Related Questions