Reputation: 1459
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
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
Reputation: 2333
There are several approaches for parallelization in F#
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. DetailsF#
has a built-in construct called "asynchronous workflows"
DetailsUpvotes: 3
Reputation: 3149
Adding a couple of pointers to what has already been mentioned in the comments:
for
loops.Upvotes: 0