# A nonblocking \`pmap\`

**URL:** <https://discourse.julialang.org/t/a-nonblocking-pmap/28613>\
**Category:** General Usage\
**Created:** [September 10, 2019, 4:21pm UTC](https://discourse.julialang.org/t/a-nonblocking-pmap/28613 "2019-09-10T16:21:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![affans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/affans/32/11911_2.png) [@affans](https://discourse.julialang.org/u/affans)\
**Post date:** [September 10, 2019, 4:21pm UTC](https://discourse.julialang.org/t/a-nonblocking-pmap/28613/1 "2019-09-10T16:21:26Z")

</div>

I am trying to run simulations in parallel but also have an updates on the simulation on the main thread. I basically have the following code:

```julia
function calibration()
    numofsims = 10
    siminfo = RemoteChannel(()->Channel{Tuple}(numofsims));
    @showprogress pmap(1:numofsims) do x
        simulation(x, siminfo)
    end

    ## make `pmap` not blocking so i can do stuff with `sims` as information is put in the channel.
end

```

As you can see, each independent simulation `simulation()` is given the `RemoteChannel` as an argument. The function then updates this channel with some information about the work that’s happening. It would be nice if `pmap` was not blocking so I can run some sort of analysis as the `RemoteChannel` is fed with information.

Any ideas how to accomplish this?
