# Reusing temporary variables (ed: Object Pools)

**URL:** <https://discourse.julialang.org/t/reusing-temporary-variables-ed-object-pools/61726>\
**Category:** General Usage\
**Created:** [May 24, 2021, 3:44pm UTC](https://discourse.julialang.org/t/reusing-temporary-variables-ed-object-pools/61726 "2021-05-24T15:44:36Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![halleysfifthinc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/halleysfifthinc/32/206280_2.png) [@halleysfifthinc](https://discourse.julialang.org/u/halleysfifthinc)\
**Post date:** [May 25, 2021, 1:18pm UTC](https://discourse.julialang.org/t/reusing-temporary-variables-ed-object-pools/61726/17 "2021-05-25T13:18:56Z")

</div>

I explored a similar concept in [this thread](https://discourse.julialang.org/t/thread-safe-buffer-correctness/60183) and you can find the code I used at [GitHub - halleysfifthinc/SafeBuffers.jl: Concurrency/multi-threading safe pre-allocated mutable buffers (e.g. arrays, etc.)](https://github.com/halleysfifthinc/SafeBuffers.jl)

It is usable as a package but is not registered nor do I have any plans at the moment to register/maintain it. That said, it solved my problem. After a quick perusal of Tamas’ ObjectPools.jl, two main differences are that my interface is thread safe and that the type of the pool (e.g. `Ref`’s would be valid, etc) isn’t restricted.

---

_[View the full topic](https://discourse.julialang.org/t/reusing-temporary-variables-ed-object-pools/61726)._
