# Threads/Parallel

**URL:** <https://discourse.julialang.org/t/threads-parallel/1101>\
**Category:** New to Julia\
**Created:** [December 22, 2016, 9:08am UTC](https://discourse.julialang.org/t/threads-parallel/1101 "2016-12-22T09:08:21Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [December 22, 2016, 12:08pm UTC](https://discourse.julialang.org/t/threads-parallel/1101/5 "2016-12-22T12:08:54Z")

</div>

> [@Jason\_McConochie](#):
>
> Using broadcasting is really neat but it seems natural that it should automatically use all cores in my laptop. How can the broadcasting method be used but each operation automatically spread on all cores. I’d prefer my library to do this.

`.` broadcasting is very new. In fact, `.` fusion of old operators like `.+` only started fusing on Julia’s v0.6 master yesterday. Threading is still experimental. However, with threading becoming more stable, and with `.` broadcasting now very solid, I am pretty sure this is coming soon.

Until then, the easiest way is just to loop and add `Threads.@threads`, i.e. instead of `y.=f.(x)`, do

```julia
Threads.@threads for i in eachindex(x)
  y[i] = f(x[i])
end

```

Or you can use a multiprocessing construct like `pmap`.

---

_[View the full topic](https://discourse.julialang.org/t/threads-parallel/1101)._
