Re: Suspend worker thread when in background
Mason Wheeler <[email protected]> Tue, 24 Jan 2017 02:01:57 +0000 (UTC)
| Newsgroups | gmane.comp.lib.sdl |
|---|---|
| Message-ID | <[email protected]> |
Paging is one thing; that refers to swapping unused memory out to the page file as part of virtual memory management. But what you're describing is unmapping the memory out of the process space, and that is absolutely not something that should be happening over the normal course of events!
Mason
From: rtrussell <[email protected]>
To: [email protected]
Sent: Monday, January 23, 2017 6:23 PM
Subject: Re: [SDL] Suspend worker thread when in background
#yiv1863998502 #yiv1863998502 -- #yiv1863998502 #yiv1863998502 body {font-size:11;}#yiv1863998502 #yiv1863998502 font, #yiv1863998502 th, #yiv1863998502 td, #yiv1863998502 p {}#yiv1863998502 p, #yiv1863998502 td {font-size:11;}#yiv1863998502 a:link, #yiv1863998502 a:active, #yiv1863998502 a:visited {}#yiv1863998502 a:hover {text-decoration:underline;}#yiv1863998502 hr {height:0px;border:solid 0px;border-top-width:1px;}#yiv1863998502 h1, #yiv1863998502 h2 {font-size:22px;font-weight:bold;text-decoration:none;line-height:120%;color:#000000;}#yiv1863998502 #yiv1863998502 .yiv1863998502bodyline {border:1px solid;}#yiv1863998502 #yiv1863998502 .yiv1863998502gen {font-size:12px;}#yiv1863998502 .yiv1863998502genmed {font-size:11px;}#yiv1863998502 .yiv1863998502gensmall {font-size:10px;line-height:12px;}#yiv1863998502 .yiv1863998502gen, #yiv1863998502 .yiv1863998502genmed, #yiv1863998502 .yiv1863998502gensmall {}#yiv1863998502 a.yiv1863998502gen, #yiv1863998502 a.yiv1863998502genmed, #yiv1863998502 a.yiv1863998502gensmall {text-decoration:none;}#yiv1863998502 a.yiv1863998502gen:hover, #yiv1863998502 a.yiv1863998502genmed:hover, #yiv1863998502 a.yiv1863998502gensmall:hover {text-decoration:underline;}#yiv1863998502 #yiv1863998502 .yiv1863998502forumlink {font-weight:bold;font-size:12px;}#yiv1863998502 a.yiv1863998502forumlink {text-decoration:none;}#yiv1863998502 a.yiv1863998502forumlink:hover{text-decoration:underline;}#yiv1863998502 #yiv1863998502 .yiv1863998502postbody {font-size:12px;line-height:18px;}#yiv1863998502 a.yiv1863998502postlink:link {text-decoration:none;}#yiv1863998502 a.yiv1863998502postlink:visited {text-decoration:none;}#yiv1863998502 a.yiv1863998502postlink:hover {text-decoration:underline;}#yiv1863998502 #yiv1863998502 .yiv1863998502code {font-size:11px;color:#3FB753;border-style:solid;border-left-width:1px;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;}#yiv1863998502 .yiv1863998502quote {font-size:11px;color:#444444;line-height:125%;border-style:solid;border-left-width:1px;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;}#yiv1863998502
|
| Eric Wing wrote: |
|
| Android will happily keep sucking up CPU cycles and battery on your app’s background threads while backgrounded. Worst case, you can just keep eating cycles. |
What I think I've seen happening is that the worker thread keeps running but the memory that it is using 'disappears', resulting in a segfault as soon as it attempts to access that memory. This was not unexpected, because I assumed it was normal for Android to 'page out' an application's memory when it is in the background, and hence my desire to suspend the worker thread so it won't try to access it.
But since you don't seem to think that leaving a worker thread running should be a major problem (other than wasting CPU cycles) am I wrong in my assumption? What would you expect to happen to memory that the application has allocated (in my case using 'mmap') when it is backgrounded?
Richard.
_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org