# context limit

**URL:** <https://forums.imgtec.com/t/context-limit/883>\
**Category:** PowerVR Insider\
**Created:** [October 28, 2010, 4:48pm UTC](https://forums.imgtec.com/t/context-limit/883 "2010-10-28T16:48:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amendol](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@amendol](https://forums.imgtec.com/u/amendol)\
**Post date:** [October 28, 2010, 4:48pm UTC](https://forums.imgtec.com/t/context-limit/883/1 "2010-10-28T16:48:00Z")

</div>

Is there a limit on the number of opengl-es2 contexts?   
  
I can only create 10 in a single process.   
  
Also, is there a system wide (multiple-process) limit to the number of contexts?

---

<div class="post-metadata">

**Author:** ![aaron](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@aaron](https://forums.imgtec.com/u/aaron)\
**Post date:** [November 3, 2010, 3:56pm UTC](https://forums.imgtec.com/t/context-limit/883/2 "2010-11-03T15:56:15Z")

</div>

Why do you want to create more than one context?  
  
  
  
  
  
Note that for performance it’s best not to use eglMakeCurrent, and rendering to textures using FBOs gives you more control than using multiple contexts.  
  
  
  
  
  
Aaron.

---

<div class="post-metadata">

**Author:** ![amendol](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@amendol](https://forums.imgtec.com/u/amendol)\
**Post date:** [November 3, 2010, 4:16pm UTC](https://forums.imgtec.com/t/context-limit/883/3 "2010-11-03T16:16:14Z")

</div>

Well, this is for an application framework. Each application is interdependently developed, and should only have to be concerned with it’s own contexts state.

---

<div class="post-metadata">

**Author:** ![aaron](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@aaron](https://forums.imgtec.com/u/aaron)\
**Post date:** [November 3, 2010, 4:25pm UTC](https://forums.imgtec.com/t/context-limit/883/4 "2010-11-03T16:25:15Z")

</div>

In that case I recommend that each “application” should have it’s own thread. If you don’t want them processing in parallel, i.e. if you want each to render a frame in turn, have a thread that round-robins each application, waking up that applications thread for a frame while sleeping itself until the frame is complete.  
  
  
  
  
  
Your situation reminds me of the browser plug-in model, where each plug-in that uses OGLES should internally create a thread to do its work, or at least all the rendering work.  
  
  
  
  
  
Much better to do that than to call eglMakeCurrent in a single thread as you switch between applications.

---

<div class="post-metadata">

**Author:** ![amendol](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@amendol](https://forums.imgtec.com/u/amendol)\
**Post date:** [November 3, 2010, 6:58pm UTC](https://forums.imgtec.com/t/context-limit/883/5 "2010-11-03T18:58:16Z")

</div>

The preference for this system is to separate applications with a process boundary for security and robustness reasons.&nbsp;
