# Multiple windows, same thread or seperate?

**URL:** <https://discourse.processing.org/t/multiple-windows-same-thread-or-seperate/24375>\
**Category:** Processing\
**Created:** [October 6, 2020, 5:18am UTC](https://discourse.processing.org/t/multiple-windows-same-thread-or-seperate/24375 "2020-10-06T05:18:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomfoolery](https://avatars.discourse-cdn.com/v4/letter/t/97f17d/32.png) [@Tomfoolery](https://discourse.processing.org/u/Tomfoolery)\
**Post date:** [October 6, 2020, 5:18am UTC](https://discourse.processing.org/t/multiple-windows-same-thread-or-seperate/24375/1 "2020-10-06T05:18:37Z")

</div>

So according to this post here:

> **[Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/20898/thread-vs-papplet-runsketch)**
>
> Processing is an electronic sketchbook, a language and a worldwide community. This is its forum.

  
Every window you run with runSketch has its own animation thread.

To test this out, I had a single window draw 100 ellipses per frame at 60 frames per second, then I had it draw 400 ellipses per frame at about 18 fps.  
I then created three extra windows, and tracked their frameRate while each drew 100 ellipses per frame, which came to about 13fps each.

If each window is on a separate thread, should my multi-core processor not be able to handle them separately, allowing 4 windows to draw a total of 400 ellipses per frame at 60fps? Why do 4 windows do a poorer job at handling the same workload as a single window?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [October 6, 2020, 3:17pm UTC](https://discourse.processing.org/t/multiple-windows-same-thread-or-seperate/24375/2 "2020-10-06T15:17:54Z")

</div>

> [@Tomfoolery](#):
>
> If each window is on a separate thread, should my multi-core processor not be able to handle them separately, allowing 4 windows to draw a total of 400 ellipses per frame at 60fps? Why do 4 windows do a poorer job at handling the same workload as a single window?

You assume that all renderers are working independently, but depending on the OS and underlying libraries for each renderer, there are a variety of actions and resources that can only be accessed one at a time, or require running on one (extra) thread.

---

<div class="post-metadata">

**Author:** ![Tomfoolery](https://avatars.discourse-cdn.com/v4/letter/t/97f17d/32.png) [@Tomfoolery](https://discourse.processing.org/u/Tomfoolery)\
**Post date:** [October 8, 2020, 12:05am UTC](https://discourse.processing.org/t/multiple-windows-same-thread-or-seperate/24375/3 "2020-10-08T00:05:06Z")

</div>

Thanks for the reply.  
That makes sense I suppose. I wonder if there’s any hope in utilizing multiple threads even in the most limited of ways.  
If anyone would like to expand on some of the inner workings nielcsmith brings up, I would love to have a more in depth understanding of how it all works.
