# Stumped by something simple

**URL:** https://discourse.processing.org/t/stumped-by-something-simple/10057
**Category:** Libraries
**Created:** [April 7, 2019, 8:33pm UTC](https://discourse.processing.org/t/stumped-by-something-simple/10057 "2019-04-07T20:33:40Z")
**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: [April 13, 2019, 6:15pm UTC](https://discourse.processing.org/t/stumped-by-something-simple/10057/9 "2019-04-13T18:15:50Z")

</div>

> [@cucurbit](#):
>
> Can you tell me the difference between the **mousePressed()** event and the **oscEvent()** that allows **mousePressed()** to draw to the screen while **oscEvent()** cannot?

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.currentThread());`

---

_[View the full topic](https://discourse.processing.org/t/stumped-by-something-simple/10057)._
