Toward more ruly background apps

R

Roedy Green

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.
 
S

Silvio Bierman

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?
 
J

Jeffrey H. Coffield

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
 
T

Tassilo Horn

Hi!
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
 
R

Roedy Green

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.
 
K

Knute Johnson

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.
 
R

Roedy Green

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?
 
A

Arne Vajhøj

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
 
F

Fistulina Hepatica

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).
 
T

thoolen

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.
 
R

Roedy Green

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top