"Does Android even do anything with thread priority?"
In my experience: Yes.

You can set a Thread's priority and it has an effect. Note, however,
that the actual priority will never be higher than the groups
priority.

When i change a background thread's priority and set it very high, the
UI responsiveness suffers. This indicates that setting the priority
has an effect.


On Apr 13, 2:24 am, Bob Kerns <[email protected]> wrote:
> My impression, not well investigated, is that your service is NOT
> likely to be killed while it is actually running on the main thread
> doing processing. I'm guessing you're doing this on a separate thread?
> Your process may be killed, but is less likely to be killed, if you
> start the service, and make it sticky. Perhaps that's the compromise
> you seek?
>
> Finally -- does it work to set down the thread priority? Does Android
> even do anything with thread priority?
>
> On Apr 12, 2:04 pm, Mariano Kamp <[email protected]> wrote:
>
>
>
> > 1) CPU is not a problem per se. My process can happily be starved of CPU,
> > but as it needs to do xml parsing it does task the CPU albeit at it's lowest
> > prio.
> > 2) As I said I rely on an external API that doesn't understand incremental
> > updates.
>
> > Anyway, I think there is no good solution and the usefulness of this thread
> > is nearing zero now, so I will stop before I waste anymore of everybody's
> > time. Thanks so far.
>
> > On Mon, Apr 12, 2010 at 10:58 PM, Mark Murphy 
> > <[email protected]>wrote:
>
> > > Mariano Kamp wrote:
>
> > > >     Quoting myself:
>
> > > > And you have done so wonderfully.
>
> > > > What is it your trying to say though?
>
> > > > That it is ok to raise the priority when I don't want my process to be
> > > > killed.
>
> > > I'm saying what Ms. Hackborn confirmed in her reply to my post --
> > > startForeground() elevates the service's process to the foreground
> > > priority class. The not-too-unreasonable assumption the SDK makes is
> > > that something that is supposed to be in the foreground is supposed to
> > > be in the foreground. I mean, "foreground" is in the method's name.
> > > There's no question the documentation could be stronger, though.
>
> > > That being said, your choices are:
>
> > > 1. Continue using startForeground() and either live with the complaints
> > > or modify your service to be less CPU-intensive, or
>
> > > 2. Stop using startForeground() and modify your architecture to better
> > > support the service being shut down
>
> > > Since Android applications have to support their services being shut
> > > down (via task killers, the Services screen in Settings, etc.), I would
> > > think #2 would be the better answer, but that's your call.
>
> > > --
> > > Mark Murphy (a Commons Guy)
> > >http://commonsware.com|http://twitter.com/commonsguy
>
> > > Android Training in NYC: 4-6 June 2010:http://guruloft.com
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]<android-developers%2Bunsubs
> > >  [email protected]>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> > > To unsubscribe, reply using "remove me" as the subject.- Hide quoted text 
> > > -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to