Safe loop with push! multi-threading

The code in the OP tries to implement threaded map. I recommend using existing solutions. For example:

You also need to know the output type of f which is impossible in general.

8 Likes