it seems like a work for a lock. check this thread: Poor performance of `lock(l) do` closures, caused by poor performance of capturing closures
1 Like
it seems like a work for a lock. check this thread: Poor performance of `lock(l) do` closures, caused by poor performance of capturing closures