*Why* do you need this? What critical code do you need to execute? Maybe there is another solution... maybe not...
If you could make some code 'critical', what if other processes tried to do the same? On Aug 28, 3:00 am, salza <floriansa...@googlemail.com> wrote: > Maybe I misunderstand something. > > Let's say thread A of process A has the priority "very important" and > thread B of process B has the priority "not so important". > In Android every process has its own Dalvik VM instance - so thread A > is in another instance than thread B. Therefor the priority of the > threads does only have an effect on other threads of the same Dalvik > VM instance. Right? > That's why (in my opinion) the thread priorities would not have an > effect on whether thread A or thread B will be done first as they are > in different Dalvik VM instances. > > The thing I want to accomplish: I have another system environment > where very critical processes exist that need a high priority. If it > is not possible to sign it with a high priority I can't use Android > for development in that system environment. > > Thanks. > > On Aug 27, 8:23 pm, Dianne Hackborn <hack...@android.com> wrote: > > > > > No, and Linux doesn't have this facility. When you set the nice on a > > process, you are setting it on the main thread of the process. Any threads > > it creates after that will inherit the priority of the original thread, > > however it will not impact any existing threads, and threads can later > > modify their priority. > > > The only thing you can do afaik is restrict the best priority any thread can > > get, and that is associated with the uid and not the process. > > > I have no clue what the relationship is between killing processes and > > setting process priorities. > > > What exactly are you wanting to accomplish? > > > On Thu, Aug 27, 2009 at 8:52 AM, salza <floriansa...@googlemail.com> wrote: > > > > So is there any method I can use, to set the priority for a process? > > > Linux normally has this ability (e.g. nice - Set process priority of > > > new processes) > > > > In the Android API I found a method to kill processes: killProcess(int > > > pid) > > > > So is there any possibility for me as a developer to use a method like > > > the killProcess-method zu manage the priority of a process? > > > > On Aug 26, 6:48 pm, Dianne Hackborn <hack...@android.com> wrote: > > > > Linux doesn't really associate priorities with processes... or more > > > > accurately, in Linux a process is a unit of execution, so each thread is > > > > also actually a process (running in the same address space), with their > > > own > > > > independent priorities. > > > > > On Wed, Aug 26, 2009 at 4:29 AM, mstu...@googlemail.com < > > > > > mstu...@googlemail.com> wrote: > > > > > > Thanks! > > > > > > Ok, I can set priority for threads... but threads running in > > > > > processes... is it therefore possible to set priority for processes as > > > > > well...? > > > > > > On 26 Aug., 00:04, 3crowntech <3crownt...@gmail.com> wrote: > > > > > > Hi Matthias, > > > > > > > You can set thread priority by android.os.Process.setThreadPriority > > > > > > method. This is how android controls resource allocation. > > > > > > Thanks. > > > > > > > On Aug 26, 5:45 am, "mstu...@googlemail.com" <mstu...@googlemail.com > > > > > > > wrote: > > > > > > > > hi all, > > > > > > > > the Android web site indicates that "all applications are created > > > > > > > equal". What is the strategy to ensure that critical applications/ > > > > > > > services have priority? > > > > > > > > Are there any facilities Android does provide to ensure certain > > > > > > > applications and/or threads to receive a minimum of CPU bandwith > > > (and > > > > > > > other apps/threads are prevented from consuming all the CPU > > > bandwith)? > > > > > > > > Matthias- Zitierten Text ausblenden - > > > > > > > - Zitierten Text anzeigen - > > > > > -- > > > > Dianne Hackborn > > > > Android framework engineer > > > > hack...@android.com > > > > > Note: please don't send private questions to me, as I don't have time to > > > > provide private support, and so won't reply to such e-mails. All such > > > > questions should be posted on public forums, where I and others can see > > > and > > > > answer them. > > > -- > > Dianne Hackborn > > Android framework engineer > > hack...@android.com > > > Note: please don't send private questions to me, as I don't have time to > > provide private support, and so won't reply to such e-mails. All such > > questions should be posted on public forums, where I and others can see and > > answer them.- 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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---