# Thead-safe Signals

**URL:** https://discourse.libcinder.org/t/thead-safe-signals/1650
**Category:** Using Cinder
**Created:** [May 6, 2020, 10:55pm UTC](https://discourse.libcinder.org/t/thead-safe-signals/1650 "2020-05-06T22:55:01Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Kino](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/kino/32/465_2.png) [@Kino](https://discourse.libcinder.org/u/Kino)
#### Post date: [May 8, 2020, 8:42pm UTC](https://discourse.libcinder.org/t/thead-safe-signals/1650/3 "2020-05-08T20:42:37Z")

</div>

Thanks a bunch @lithium. I was aware of the `io_service` in Cinder through using `asio` but had no idea about `dispatchAsync()`. I searched the discourse and found [this](https://discourse.libcinder.org/t/drawsolidrect-raises-gl-invalid-operation-intermittently-threading-issue/1389/12) other thread with you yourself explaining it which helped a lot.

To resolve the issue of adding connections mid-program, can I maybe use an `std::atomic<Signal>` or something similar? or a `mutex`? or will that not work?

Also do you know if I connect events to Cinder’s main `update` signal, do they happen before each `update` or after the `update` before the `draw`? Is there a way to set the order of how these events are called? Sorry this is not a threading question per se but since the workaround is to have an `update` event in my class that is connected to Cinder’s, I thought I’d ask. Thanks!

---

_[View the full topic](https://discourse.libcinder.org/t/thead-safe-signals/1650)._
