# Multithreading and ProductIterator

**URL:** <https://discourse.julialang.org/t/multithreading-and-productiterator/33405>\
**Category:** General Usage\
**Tags:** multithreading\
**Created:** [January 15, 2020, 4:41pm UTC](https://discourse.julialang.org/t/multithreading-and-productiterator/33405 "2020-01-15T16:41:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Jakub\_Wronowski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jakub_wronowski/32/204030_2.png) [@Jakub\_Wronowski](https://discourse.julialang.org/u/Jakub_Wronowski)\
**Post date:** [January 15, 2020, 8:07pm UTC](https://discourse.julialang.org/t/multithreading-and-productiterator/33405/2 "2020-01-15T20:07:08Z")

</div>

I’d go something like

```julia
Threads.@threads for i in x
    for j in y
        id = Threads.threadid();
        @info "$id <== ($i, $j)"
    end
end

```

This package could be helpful for parallel problems:

> [@Thread- and process-based parallelisms in Transducers.jl (+ some news)](https://discourse.julialang.org/t/thread-and-process-based-parallelisms-in-transducers-jl-some-news/32285):
>
> It’s been a while since I added parallelism supports in Transducers.jl but I’ve never announced this feature properly. I just added a few utility functions and a tutorial so I think it’s good timing to do this. Quoting [Overview of parallel processing in Transducers.jl](https://tkf.github.io/Transducers.jl/dev/parallelism/): Transducers.jl supports thread-based ([reduce](https://tkf.github.io/Transducers.jl/dev/manual/#Base.reduce)) and process-based ([dreduce](https://tkf.github.io/Transducers.jl/dev/manual/#Transducers.dreduce)) parallelisms with the same composable API; i.e. transducers. Having a uniform API to cover different parallelisms as well as sequential processing [fold…](https://tkf.github.io/Transducers.jl/dev/manual/#Base.foldl)

---

_[View the full topic](https://discourse.julialang.org/t/multithreading-and-productiterator/33405)._
