# PApplet call order (multi-threading thread safety)

**URL:** <https://discourse.processing.org/t/papplet-call-order-multi-threading-thread-safety/21447>\
**Category:** Processing\
**Created:** [May 31, 2020, 9:57am UTC](https://discourse.processing.org/t/papplet-call-order-multi-threading-thread-safety/21447 "2020-05-31T09:57:04Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 1, 2020, 10:33am UTC](https://discourse.processing.org/t/papplet-call-order-multi-threading-thread-safety/21447/9 "2020-06-01T10:33:44Z")

</div>

> [@Stumped by something simple](https://discourse.processing.org/t/stumped-by-something-simple/10057/9):
>
> Even though Processing enqueues input events in a separate Thread, it dequeues them in the main “Animation” Thread. So it’s safe to “draw” when using Processing’s own input callbacks. Now, if a 3rd-party library deals w/ hardware, its callbacks got a very high chance to happen in a separate Thread. Therefore, it’s highly unsafe to mutate the main canvas under a separate Thread. In order to find out which Thread is executing a method, just place this statement there: println(Thread.currentTh…

- [Is this a known bug? - Processing 2.x and 3.x Forum](http://Forum.Processing.org/two/discussion/24624/is-this-a-known-bug#Item_13)
- [push exceeding 32 use limit - Processing 2.x and 3.x Forum](http://Forum.Processing.org/two/discussion/15972/push-exceeding-32-use-limit#Item_12)

---

_[View the full topic](https://discourse.processing.org/t/papplet-call-order-multi-threading-thread-safety/21447)._
