Re: Suspend worker thread when in background
Daniel Gibson <[email protected]> Fri, 20 Jan 2017 03:30:54 +0100
| Newsgroups | gmane.comp.lib.sdl |
|---|---|
| Message-ID | <[email protected]> |
Well ok, this sucks. Is there a way to tell Android to wait a little with either "paging out" the memory or even with switching to another app? Otherwise I have no idea, but maybe someone who (unlike me) has actual experience with Android can help ;) Cheers, Daniel On 20.01.2017 01:24, rtrussell wrote: > > Shouldn't it? This is what the SDL docs say about the app events > <https://wiki.libsdl.org/SDL_EventType#Android.2C_iOS_and_WinRT_Events>: > "These events must be handled in an event filter, since often the OS > needs an immediate response and will terminate your process shortly > after sending the event, and if it sits in the SDL event queue, it'll be > too late". I interpreted this as meaning that the app must respond in > less than a frame period (which is typically how long an SDL app might > take before checking the event queue), so even a few milliseconds might > be too long. > > When I trace the crashes with logcat I see my worker thread trying to > access memory that Android has already 'paged out' whilst putting my app > into the background. Subjectively this is happening 'instantly', not > after a few seconds. > > Richard. > > > _______________________________________________ > SDL mailing list > [email protected] > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org >