Multicore processor utilization

I was wondering how many developers actually utilize multiple cores when writing code. Are there any stats to show this?

I don’t know where to find stats, but I have done parallel processing in F# and C++. It should be fairly common by now, though maybe still a minority do it.

A lot of times you get multicore ‘for free’ with F#, especially when you are talking about network processing as is typical of web frameworks and such. When you have a Task<'t> or Async<'t> and enqueue that work it can be processed on any available thread in the threadpool. As for parallel data processing, libraries like Hopac, TPL Dataflow, or Akka Streams enable easy development of algorithms that scale across threads/cores as well. So there’s tons of opportunity for multicore processing if the programmer needs it I’d say.

I have seen some code bases where I didn’t see a lot of code executed in parallel and talked to few programmers and what they told me is that they don’t write a lot of parallel code. Apart from what is in the frameworks there is no effort from devs to utilize multicore.

Constantly. Usually in the form of:

async {
    return!
        arrayOfItems
        |> Array.map doSomethingOverNetworkThatReturnsAsync
        |> Async.Parallel
}

Or if I’m mapping over an array of items and the operation can be done in parallel (but doesn’t require Async) I’ll use Array.Parallel.map.

I am pretty sure that these days the majority of developers are using parallel processing.
The questions should be, how many developers are using parallel programming correctly ? :slight_smile:

This is an easy way in F#: http://fsprojects.github.io/FSharp.Collections.ParallelSeq/

There are many different types of developers solving different types of problems. I have worked in a web development team where no one ever thought to make things explicitly parallel or multi-threaded, probably because there was already a lot of implicit parallelism due to the way that the web framework handled many simultaneous incoming requests. The servers kept their cores busy without the devs even trying. And then on the front-end they couldn’t make use of parallelism anyway since JavaScript is single threaded.

I’m sure that developers writing more back-end batch processing code consider parallelism a lot more often. I doubt there is any way to get real numbers on this because of the size and diversity of the population involved.