9.5android thread priority, go and rust comparison

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Thread Priority setting:
http://droidyue.com/blog/2015/09/05/android-process-and-thread-schedule-nice/
Linux priority settings: sudo renice-n 0-p 24161

Android Priority settings:
The thread priority level in Android is now defined as the relationship between the priority of the process and the nice value, and the relationship between the thread priority and the value is much easier to understand.

Thread_priority_default, the default thread priority, with a value of 0.
Thread_priority_lowest, the lowest thread level, with a value of 19. The
Thread_priority_background background thread recommends setting this priority at a value of 10. The
Thread_priority_foreground user is interacting with the UI thread, the priority cannot be set in the code, and the system adjusts to that priority, with a value of-2. The
Thread_priority_display is also a priority for UI interaction, but is preferable to thread_priority_foreground, which cannot be set in the code and is adjusted by the system with a value of-4. The
Thread_priority_urgent_display displays the highest level of the thread for processing the drawing screen and retrieving input events that cannot be set to that priority in the code. The value is-8. The
Thread_priority_audio the standard level of the sound thread, which cannot be set to this priority with a value of-16. The
Thread_priority_urgent_audio the highest level of the sound thread, with a higher priority than Thread_priority_audio. The priority cannot be set in the code. The value is-19. The
Thread_priority_more_favorable is slightly preferred relative to Thread_priority_default and has a value of-1. The
Thread_priority_less_favorable is slightly behind relative thread_priority_default, with a value of 1. The
using the Android API to prioritize threads is also simple, just call the Android.os.Process.setThreadPriority method when the thread executes. This thread runtime modifies the priority level, which is similar to Renice.

new Thread () {    @Override    publicvoidrun() {      super.run();        android.os.Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);    }}.start();

Java Native API setting priority will expire on Android

Go and rust comparison
http://www.csdn.net/article/2015-09-01/2825605
One of the things that impressed me.

stringstring {    "HEAD"))    string(head_bytes)    if err != nil {        log.Fatal("Cannot open HEAD from ", git_dir)    }    r, _ := regexp.Compile("ref: ref/heads/(.+)")    match := r.FindStringSubmatch(head)    match[1]//这个假设,go可以编译通过,但rust编译器提示需要判断.    return branch}

It seems like some people say it's not a generic type.

Bug
Requestlayout () improperly called by

Http://stackoverflow.com/questions/24598977/android-requestlayout-improperly-called
How do I fix this?
Android:fastscrollenabled= "false"

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.