top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

Thread priority for intensive disk I/O operations using android?

+1 vote
231 views

What is best thread priority for intensive disk I/O operations - Foreground or Background?

posted Jul 28, 2013 by Abhay Kulkarni

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

2 Answers

+1 vote

Using a foreground priority isn't going to help anything anyway, provided your operations use large chunks for transfers: you're just going to be using compute time waiting for I/O operations to finish.

answer Jul 28, 2013 by Sonu Jindal
0 votes

Id recommend for the sake of the user to push all I/O work to the background to provide efficient reporting.

answer Jul 28, 2013 by Amit Parthsarthi
Similar Questions
+3 votes

We using C++ in the media layer and we want to raise the priority of our _AUDIO PROCESSING_ thread, to make sure the audio works well even the CPU is high (totally %98 on an slow Phone).

I have searched on google and find to use _setpriority( PRIO_PROCESS, 0, priority); but _setpriority function is change the process priority instead of the thread.

I know there is Java API to do that, but we need an C++ API. So does there any way to raise an single thread priority from C++ code?

0 votes

I made an app (Java based, without JNI stuff), to stress our android device. It does some intensive work and /sdcard IO writes (They are 60 threads) all of them are with FOREGROUND priority.

After a couple of minutes appeared crashes in different places (system_server - FinalizerDaemon timeouts) and then the Watchdog rebooted the device with message Watchdog killing system process: null.

I tested it also on Nexus 7 and other android devices in production, the behavior is the SAME. It seems that some apk, can overload the system and to reboot the user-space.

Is this behavior (under high pressure/load from FOREGROUND threads) is by design in android Jelly-Bean and are there any plans for some remedy for this situation.

+3 votes

My question is regarding the PC register value of which is giving to the created thread.

if I create a new process with fork() the PC value will be copied from parent to child as PC value is the next command in the code.

However if I create a new thread as following

#include <pthread.h>
int pthread_create(pthread_t *restrict tidp, const pthread_attr_t *restrict attr, void *(*start_rtn)(void), void *restrict arg)

with:

err = pthread_create(&thready, NULL, &mythread, NULL);

Now the question is where the created thread gets it's PC value. How does the PC value set to the first line of mythread code?

+4 votes

I have my Code . Kindly make it correct .

  protected void Button1_Click(object sender, EventArgs e)
  {
        System.Threading.Thread.Sleep(500);
        Image1.ImageUrl = "Below15.png";
        System.Threading.Thread.Sleep(500);
        Image1.ImageUrl = "Below26.png";
        System.Threading.Thread.Sleep(500);
        Image1.ImageUrl = "Below31.png";
        System.Threading.Thread.Sleep(500);
        Image1.ImageUrl = "Below40.png";
        System.Threading.Thread.Sleep(500);
        Image1.ImageUrl = "Above70.png";
 }

Useful Links with Similar Problem
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#470/147, 3rd Floor, 5th Main,
HSR Layout Sector 7,
Bangalore - 560102,
Karnataka INDIA.
QUERY HOME
...