Thread management in SDL

From this URL: https://wiki.libsdl.org/CategoryThread

there’s this quote right at the top of the page:

NOTE: You should not expect to be able to create a window, render, or
receive events on any thread other than the main one. For platform-specific
exceptions or complicated options ask on the mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.orgor forum
http://forums.libsdl.org/viewtopic.php?t=5973.
This is the issue that I am running into on android for implementing
multiple instances.

I will need to be able to create multiple main threads but I do not need to
interact with more than one thread at a time.

How is the SDL main thread created on android and when does that get
attached to the SDL lifecycle?

Would it be possible to create the thread, pause it and then give that
thread a egl surface at a later time?

If I read this correctly

http://developer.android.com/guide/components/processes-and-threads.html#
Threads

then the system creates the “main” thread by itself upon launch of the app.
And this is probably the only one that is allowed to do UI work, as also
noted in the SDL wiki.

My best guess is that this limitation is intended. Only one thread per app/
process/… shall render to screen.

---------- P?vodn? zpr?va ----------
Od: Owen Alanzo Hogarth
Komu: SDL Development List
Datum: 28. 9. 2015 13:54:06
P?edm?t: [SDL] Thread management in SDL

"

From this URL:?https://wiki.libsdl.org/CategoryThread
(https://wiki.libsdl.org/CategoryThread)

there’s this quote right at the top of the page:

NOTE: You should not expect to be able to create a window, render, or
receive events on any thread other than the main one. For platform-specific
exceptions or complicated options ask on the?mailing list
(http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)or?forum
(http://forums.libsdl.org/viewtopic.php?t=5973).

This is the issue that I am running into on android for implementing
multiple instances.

I will need to be able to create multiple main threads but I do not need to
interact with more than one thread at a time.

How is the SDL main thread created on android and when does that get
attached to the SDL lifecycle?

Would it be possible to create the thread, pause it and then give that
thread a egl surface at a later time?_______________________________________________
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org"

I can manage the main thread from android, the main issue happens is if I
try to init sdl twice, i’ll get a crash, because android only gives you one
surface at a time.

What I would like to do is be able to init SDL and not have it crash, then
be able to pass it a surface for it to associate with and setup. I’ll never
actually be rendering on two surfaces at once but I need up to two
instances of SDL running keeping their state separate. One with an active
window and one with a window.

Is there a way to say SDL then at a later time tell SDL to create a window
by passing it a surface?On Mon, Sep 28, 2015 at 8:06 PM, hardcoredaniel wrote:

If I read this correctly

http://developer.android.com/guide/components/processes-and-threads.html#Threads

then the system creates the “main” thread by itself upon launch of the
app. And this is probably the only one that is allowed to do UI work, as
also noted in the SDL wiki.

My best guess is that this limitation is intended. Only one thread per
app/process/… shall render to screen.

---------- P?vodn? zpr?va ----------
Od: Owen Alanzo Hogarth <@Owen_Alanzo_Hogarth>
Komu: SDL Development List
Datum: 28. 9. 2015 13:54:06
P?edm?t: [SDL] Thread management in SDL

From this URL: https://wiki.libsdl.org/CategoryThread

there’s this quote right at the top of the page:

NOTE: You should not expect to be able to create a window, render, or
receive events on any thread other than the main one. For platform-specific
exceptions or complicated options ask on the mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.orgor forum
http://forums.libsdl.org/viewtopic.php?t=5973.
This is the issue that I am running into on android for implementing
multiple instances.

I will need to be able to create multiple main threads but I do not need
to interact with more than one thread at a time.

How is the SDL main thread created on android and when does that get
attached to the SDL lifecycle?

Would it be possible to create the thread, pause it and then give that
thread a egl surface at a later time?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org