Toward more ruly background apps

Discussion in 'Java' started by Roedy Green, Nov 24, 2011.

  1. Roedy Green

    Roedy Green Guest

    I usually have at least one active background task going, e.g. defrag,
    build, search and replace script, indexing, backup, Jet compile,
    program load, source code tidy, email fetch, FTP upload, macro
    expansion to regenerate my website ....

    The problem is these often interfere with my foreground work. I hit a
    key and nothing happens for several seconds. I find it quite hard to
    type word without the instant visual feedback.

    The background task may be hogging the CPU or the disk. Back in the
    60s I learned about what OS's were supposed to do to ameliorate this,
    giving higher priority to i/o bound tasks and higher priority to tasks
    a human was sitting there waiting for.

    I am using Windows 7 on a dual CPU which was orders of magnitude
    resources to play with that the computers of that day, but it does not
    seem to be doing all that well.

    So some questions:

    1. Is there anything I can do to make my OWN background Java apps
    better behaved, to notice disk or CPU is tight and back off? or lower
    their priority to CPU or disk?

    2. Is there anything I can do to configure some sort of allocation of
    the CPU and disk where various combos of app are running?

    3. Is there anything I can do quickly when my computer is sluggish to
    throttle but not kill the culprit?

    4. Do Linux people fare any better? I imagine most windows users have
    programs in the background, but they would nearly always be idle. This
    problem is likely not high on the MS priority list.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    I can't come to bed just yet. Somebody is wrong on the Internet.
    Roedy Green, Nov 24, 2011
    #1
    1. Advertising

  2. On 11/24/2011 02:44 PM, Roedy Green wrote:
    >
    > 4. Do Linux people fare any better? I imagine most windows users have
    > programs in the background, but they would nearly always be idle. This
    > problem is likely not high on the MS priority list.


    I run Linux on a laptop with an Intel i7 inside (where else would it
    be?). I usually have a running VirtualBox that runs either WindowsVista
    or Windows7 to have an IE/Windows client test environment for my web
    application development. Windows is usually quite idle except for a
    running IE and sometimes OpenOffice but I have to assign at least two of
    my eight cores and plenty of memory to it to have any decent response
    when typing etc.

    On the Linux side I never have any responsiveness problems like that.

    Nothing is perfect, though. There seems to be a bug somewhere that
    disables my touchpad permanently every now and then during typing which
    is very annoying when the laptop is actually, well, on my lap. Luckily
    in Linux this can always be solved with some command line that can be
    attached to a key stroke so a simple CTRL+ALT+` fixes that.

    Is there a particular reason you run Windows?
    Silvio Bierman, Nov 24, 2011
    #2
    1. Advertising

  3. On 11/24/2011 05:44 AM, Roedy Green wrote:
    > I usually have at least one active background task going, e.g. defrag,
    > build, search and replace script, indexing, backup, Jet compile,
    > program load, source code tidy, email fetch, FTP upload, macro
    > expansion to regenerate my website ....
    >
    > The problem is these often interfere with my foreground work. I hit a
    > key and nothing happens for several seconds. I find it quite hard to
    > type word without the instant visual feedback.
    >
    > The background task may be hogging the CPU or the disk. Back in the
    > 60s I learned about what OS's were supposed to do to ameliorate this,
    > giving higher priority to i/o bound tasks and higher priority to tasks
    > a human was sitting there waiting for.
    >
    > I am using Windows 7 on a dual CPU which was orders of magnitude
    > resources to play with that the computers of that day, but it does not
    > seem to be doing all that well.
    >
    > So some questions:
    >
    > 1. Is there anything I can do to make my OWN background Java apps
    > better behaved, to notice disk or CPU is tight and back off? or lower
    > their priority to CPU or disk?
    >
    > 2. Is there anything I can do to configure some sort of allocation of
    > the CPU and disk where various combos of app are running?
    >
    > 3. Is there anything I can do quickly when my computer is sluggish to
    > throttle but not kill the culprit?
    >
    > 4. Do Linux people fare any better? I imagine most windows users have
    > programs in the background, but they would nearly always be idle. This
    > problem is likely not high on the MS priority list.


    Unix/Linux has nice.

    OpenVMS has set process/priority

    Windows has solitaire.

    (Couldn't resist that)

    Try looking at http://xona.com/2004/07/22.html

    Jeff Coffield
    Jeffrey H. Coffield, Nov 24, 2011
    #3
  4. Roedy Green

    Tassilo Horn Guest

    "Jeffrey H. Coffield" <> writes:

    Hi!

    >> 4. Do Linux people fare any better? I imagine most windows users
    >> have programs in the background, but they would nearly always be
    >> idle. This problem is likely not high on the MS priority list.

    >
    > Unix/Linux has nice.


    Yep, for CPU scheduling, and additionally ionice for IO scheduling. And
    there are demons like verynice that can be used to automatically adjust
    priorities for certain applications, e.g., compile tasks.

    Nowadays, there're also control groups in the kernel that allow for
    grouping processes and setting policies for them.

    Bye,
    Tassilo
    --
    (What the world needs (I think) is not
    (a Lisp (with fewer parentheses))
    but (an English (with more.)))
    Brian Hayes, http://tinyurl.com/3y9l2kf
    Tassilo Horn, Nov 24, 2011
    #4
  5. Roedy Green

    Roedy Green Guest

    On Thu, 24 Nov 2011 16:27:30 +0100, Silvio Bierman <>
    wrote, quoted or indirectly quoted someone who said :

    >Is there a particular reason you run Windows?


    It used to be because all my customers did and because I own so much
    Windows software. I also figured anything I produced free, first and
    foremost had to work on Windows.

    Those reasons is not as valid anymore. I could simply test under
    windows, but do the development in Linux.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    I can't come to bed just yet. Somebody is wrong on the Internet.
    Roedy Green, Nov 24, 2011
    #5
  6. On 11/24/2011 8:41 AM, Roedy Green wrote:
    > On Thu, 24 Nov 2011 16:27:30 +0100, Silvio Bierman<>
    > wrote, quoted or indirectly quoted someone who said :
    >
    >> Is there a particular reason you run Windows?

    >
    > It used to be because all my customers did and because I own so much
    > Windows software. I also figured anything I produced free, first and
    > foremost had to work on Windows.
    >
    > Those reasons is not as valid anymore. I could simply test under
    > windows, but do the development in Linux.


    I recently did a project where all the development was done under Linux.
    The program ran smoother and faster under Linux than it does under
    Windows. My clients however have much faster computers and that made it
    work fine on their machines too. I think Windows is just a resource and
    processor hog and that Linux has a smoother interrupt and timing
    environment.

    --

    Knute Johnson
    Knute Johnson, Nov 24, 2011
    #6
  7. Roedy Green

    Roedy Green Guest

    On Thu, 24 Nov 2011 09:24:12 -0800, Patricia Shanahan <>
    wrote, quoted or indirectly quoted someone who said :

    >On Windows, bring up the Task Manager, Processes tab. Look for the
    >process you want to throttle. Right click it, and use "Set Priority" to
    >give it a below normal priority.


    That takes so long. Is there way to do it with a batch script or a
    tiny utility?
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    I can't come to bed just yet. Somebody is wrong on the Internet.
    Roedy Green, Nov 24, 2011
    #7
  8. Roedy Green

    Arne Vajhøj Guest

    On 11/24/2011 8:44 AM, Roedy Green wrote:
    > I usually have at least one active background task going, e.g. defrag,
    > build, search and replace script, indexing, backup, Jet compile,
    > program load, source code tidy, email fetch, FTP upload, macro
    > expansion to regenerate my website ....
    >
    > The problem is these often interfere with my foreground work. I hit a
    > key and nothing happens for several seconds. I find it quite hard to
    > type word without the instant visual feedback.
    >
    > The background task may be hogging the CPU or the disk. Back in the
    > 60s I learned about what OS's were supposed to do to ameliorate this,
    > giving higher priority to i/o bound tasks and higher priority to tasks
    > a human was sitting there waiting for.
    >
    > I am using Windows 7 on a dual CPU which was orders of magnitude
    > resources to play with that the computers of that day, but it does not
    > seem to be doing all that well.
    >
    > So some questions:
    >
    > 1. Is there anything I can do to make my OWN background Java apps
    > better behaved, to notice disk or CPU is tight and back off? or lower
    > their priority to CPU or disk?
    >
    > 2. Is there anything I can do to configure some sort of allocation of
    > the CPU and disk where various combos of app are running?
    >
    > 3. Is there anything I can do quickly when my computer is sluggish to
    > throttle but not kill the culprit?
    >
    > 4. Do Linux people fare any better? I imagine most windows users have
    > programs in the background, but they would nearly always be idle. This
    > problem is likely not high on the MS priority list.


    The core of this problem is not Java related.

    AFAIK, the only thing you can control from Java is thread
    priority via Thread setPriority - and I don't even know how
    much effect setting it really would have on your problems.

    Arne
    Arne Vajhøj, Nov 25, 2011
    #8
  9. On 24/11/2011 6:36 PM, Roedy Green wrote:
    > On Thu, 24 Nov 2011 09:24:12 -0800, Patricia Shanahan<>
    > wrote, quoted or indirectly quoted someone who said :
    >
    >> On Windows, bring up the Task Manager, Processes tab. Look for the
    >> process you want to throttle. Right click it, and use "Set Priority" to
    >> give it a below normal priority.

    >
    > That takes so long. Is there way to do it with a batch script or a
    > tiny utility?


    The information at http://xona.com/2004/07/22.html (which another user
    posted elsewhere in this thread) suggests how to start a process (such
    as a JVM) with priority reduced from the outset. I'd guess that
    /abovenormal, /high, and /realtime could also be used to start a process
    with elevated priority (say, an I/O bound task you want to remain very
    responsive).
    Fistulina Hepatica, Nov 25, 2011
    #9
  10. Roedy Green

    thoolen Guest

    On Nov 24, 10:01 pm, "Manh Tuong Lewis Nguyen", an obvious murphy
    sock, wrote:
    NaN> Newsgroups: comp.lang.java.programmer

    NaN> making a fist of a guess, "seamus" Derbyshire, is no
    NaN> enhancement of your plagiaristic dumma than a box
    NaN> of rocks subterfuge attempts.

    Who is "seamus Derbyshire", murphy? There is nobody in this newsgroup
    using that alias. And what does your non sequitur have to do with
    Java, murphy?

    NaN> "seamus" Derbyshire records updated follow -

    Who is "seamus Derbyshire", murphy? There is nobody in this newsgroup
    using that alias.

    NaN> names are missing as I aint so skilled as the "Murphy".

    What does your classic contradiction have to do with Java, murphy? You
    can't be less skilled than yourself, murphy, despite being very low in
    skills in any absolute sense.

    "I had 'volunteered (years back) to support those who do endeavor
    to provide free Free Usenet access, support those who offered
    subscription based Free Usenet access, nothing more than
    cooperation expected in return for what has been many
    thousands of hours of work. I note most of those I joined with
    are either deceased, severely disabled, or plain ole' MIA..
    now it is my Time. ...

    You just read my last. ...

    For those who think they see me in future times I can only wish
    you severe Tinnitus in your dreams. For those who know me
    well (eMail, whatever) and see me, know I will be smiling also.
    It is to you I say "adieu mein frenz and adios .. grazie' [hugs]
    for all the Good Times! May you and yours always bear well
    with all Life brings you".

    /0ut"
    --murphy

    http://www.uffnet.com/kookkamp/goodbye.htm

    And some people wonder why I call them Famous Last Words.
    thoolen, Nov 25, 2011
    #10
  11. Roedy Green

    Roedy Green Guest

    On Thu, 24 Nov 2011 22:29:21 -0500, Fistulina Hepatica
    <> wrote, quoted or indirectly quoted
    someone who said :

    >The information at http://xona.com/2004/07/22.html (which another user
    >posted elsewhere in this thread) suggests how to start a process (such
    >as a JVM) with priority reduced from the outset.


    You would think it would work the way. If I am typing, and the OS
    notices either the echo is delayed more than a tenth of a second or I
    am typing very slowly (presumably because I can't see the echo), it
    should bump the priority of my task relative to everything else and
    schedule disk i/o so that not only my task gets priority, but other
    tasks use disk sparingly if I am doing any use at all.

    This is very dynamic. If I stop typing, priorities should revert to
    normal.

    In other words, treat the user the way they did in Tron.

    The scheduler is deep in the heart of the OS, unlikely easy to be
    tampered with. However, it might be possible for some privileged task
    to dynamically adjust task priorities based on its intercepting of all
    keystrokes, Given that keystrokes could appear is so many places it
    would require tapping into many places to notice the echo. It would
    be a feature you build into the guts of the GUI.

    Perhaps just typing should crank your priority way up, even if you
    don't need it, even if the echo is already sufficiently fast. That
    might be something you could do within a single app without too much
    tricky system integration.
    ..



    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    For me, the appeal of computer progamming is that
    even though I am quite a klutz,
    I can still produce something, in a sense
    perfect, because the computer gives me as many
    chances as I please to get it right.
    Roedy Green, Nov 30, 2011
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Frankie

    OT: Toward WYSIWYG Web Page Authoring

    Frankie, Oct 2, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    393
    Mr Newbie
    Oct 2, 2005
  2. Replies:
    0
    Views:
    333
  3. Replies:
    1
    Views:
    312
    Mats Lycken
    Mar 9, 2006
  4. Roedy Green

    Toward more efficient ArrayLists

    Roedy Green, Jun 28, 2003, in forum: Java
    Replies:
    10
    Views:
    1,477
    Jon Skeet
    Jul 3, 2003
  5. Roedy Green

    Toward more extensive use of final

    Roedy Green, Mar 7, 2006, in forum: Java
    Replies:
    17
    Views:
    616
    Stefan Schulz
    Mar 8, 2006
Loading...

Share This Page