Do new threads inherit the priority of the creating thread in native code?

by Doug » Thu, 16 Dec 2010 08:03:29 GMT


Sponsored Links
 Does anyone know in Android/Linux if new threads inherit the priority
of the creating thread?  I'm setting the priority of a thread using
android.os.Process.setThreadPriority, which calls permanently into
native code, and that native code is going to create more threads, so
I'd like to know what priority those natively-created thread are going
to run with.

Doug

-- 



Re: Do new threads inherit the priority of the creating thread in native code?

by fadden » Sat, 18 Dec 2010 05:38:01 GMT


 


You can use "adb shell ps -p -t" to display all threads in all
processes, with their priorities.

-- 


Sponsored Links


Re: Do new threads inherit the priority of the creating thread in native code?

by Bytes » Tue, 21 Dec 2010 14:55:14 GMT


 fadden <fadden <at> android.com> writes:




Fadden -

On executing this command, I see priority and nice values. 

Sometimes I tend to adjust nice values using 'nice' command to get more 
priority to my thread. But the behaviour is not consistant. 

On non-rooted phone, how can set higher priority (Priority: 0 or -Ve) to my 
native thread ?

Thanks for your time.

regards
-Bytes

-- 



Re: Do new threads inherit the priority of the creating thread in native code?

by Doug » Wed, 22 Dec 2010 14:16:16 GMT


 


android.os.Process.setPriority()

-- 



Re: Do new threads inherit the priority of the creating thread in native code?

by Doug » Wed, 22 Dec 2010 14:17:11 GMT


 


Oops, I meant android.os.Process.setThreadPriority()

-- 



Other Threads

1. Need Help with diaplaying Menu

Group,

I can not display option menu as simple as below.

public class menu extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
    public boolean onCreatgeOptionsMenu(Menu menu)
    {
        super.onCreateOptionsMenu(menu);
        menu.add(Menu.NONE ,0,Menu.NONE, "A");
        menu.add(Menu.NONE,1,Menu.NONE,"B");
        return true;
    }
    public boolean onOptionsItenSelected(MenuItem item)
    {
        switch(item.getItemId())
        {
                case 0:
                        Toast
                        .makeText(this, "A Selected", 1);
                        return(true);
                        //super.onOptionsItemSelected(item);
                case 1:
                        Toast
                        .makeText(this,"B Selected",1);
                        return(true);
                        //super.onOptionsItemSelected(item);

        }
        return false;
    }

}

Is there some changes in SDK 1,0 that I am not aware of?

Thanks,
Dipen
--~--~---------~--~----~------------~-------~--~----~

2. Nokia N810 Skin for Android Emulator

Hello folks.

The new Nokia N810 Internet Tablet skin for the Android Emulator is
ready for taking.
screen resolution is WVGA (800x480).

http://www.android.encke.net/#Nokia-N810

Enjoy.
--~--~---------~--~----~------------~-------~--~----~

3. ProgressBar no coming on a ListActivity

4. Unable to install the .apk file via OTA in Android 1.0 release

5. Is it possible to connect two android with different machine?

6. current page's url

7. Using the battery state