# Program Structure when muliple routines need to access State

**URL:** <https://discourse.julialang.org/t/program-structure-when-muliple-routines-need-to-access-state/42918>\
**Category:** Performance\
**Tags:** question, performance, multithreading\
**Created:** [July 12, 2020, 3:04am UTC](https://discourse.julialang.org/t/program-structure-when-muliple-routines-need-to-access-state/42918 "2020-07-12T03:04:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![longemen3000](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/longemen3000/32/7298_2.png) [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Post date:** [July 12, 2020, 5:45am UTC](https://discourse.julialang.org/t/program-structure-when-muliple-routines-need-to-access-state/42918/2 "2020-07-12T05:45:16Z")

</div>

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](https://discourse.julialang.org/t/poor-performance-of-lock-l-do-closures-caused-by-poor-performance-of-capturing-closures/42067)

---

_[View the full topic](https://discourse.julialang.org/t/program-structure-when-muliple-routines-need-to-access-state/42918)._
