any way to commit idle tasks in unix?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users any way to commit idle tasks in unix?
# 1  
Old 02-12-2008
any way to commit idle tasks in unix?

I need to do some code benchmarking in unix.

On windows, it is always recommended that before you run any kind of benchmark, that you execute the command
Code:
Rundll32.exe advapi32.dll,ProcessIdleTasks

which commits idle tasks, so that hopefully this does not happen in the middle of your benchmark and distort the result. See Benchmarking on Windows XP: Home Edition and Professional for details.

Is there any analogous command for unix, or other actions that I should perform before doing a benchmark?

Please let me know if there are variations for different unices (e.g. linux, solaris, etc).
# 2  
Old 02-12-2008
What you are asking is kind of non-sequitur for unix. Benchmarking does not measure elapsed time, use a tool like time
Code:
time my_benchmark_code parm1 parm2

It gives output like this:
Code:
real     0m0.44s
user    0m0.21s
sys     0m0.01s

real = wall time
user = time in user mode
sys = time in kernel mode

If your code is printing out elapsed times this will not work.
# 3  
Old 02-13-2008
Quote:
Originally Posted by jim mcnamara
...use a tool like time
Code:
time my_benchmark_code parm1 parm2

Thanks for the tip--I was not aware of that command. I can see that it would be very useful for all kinds of benchmarking.

Unfortunately, it is not useful for my case, however. Maybe I should have put more details in original posting: I will be benchmarking various random code from within a Java program, and Java already offers APIs for accessing wall clock, system, and user times. So I already have all that functionality--in nice wonderful platform independent form.

I was just wondering if unix had the same idle task issue (and similar solution) as windows does.

Note: I will switch to using the term idle process below, as it looks like idle task in unix refers to a real specific process. (Maybe background process or daemon or something else would be a better term?)

You say:

Quote:
Originally Posted by jim mcnamara
What you are asking is kind of non-sequitur for unix.
A non-sequitur is a conclusion that does not follow from its premises--I was not aware that my mere inquiry had either premises or a conclusion!

Maybe what you mean is that my question simply has no meaning in unix. Is that because unix has no concept of idle processes like windows? Or is it because there is no way that idle processes can suddenly come alive in the middle of your benchmark like they can in windows?

The web searching that I did on the time command said nothing about it first committing idle processes, by the way.
# 4  
Old 02-15-2008
Correct - it makes no sense in unix. You do not "commit idle processes" in unix.
If I understand what you mean, init does that on it's own.
# 5  
Old 02-15-2008
Question: why would you "commit" idle processes before benchmarking, when in real life whatever you are benchmarking would probably have to run when these idle process run?
# 6  
Old 02-19-2008
Quote:
Originally Posted by jim mcnamara
Correct - it makes no sense in unix. You do not "commit idle processes" in unix.
If I understand what you mean, init does that on it's own.
Did you read that Microsoft tech link that I included in my first post?

"Commiting idle tasks" in windows means that idle (usually low priority?) processes, which have not completed yet, are suddenly given priority and run.

You want to do this before a benchmark so that no such idle task suddenly comes alive in the middle of your benchmark for whatever reason and contaminates your benchmark.

Thanks for pointing out init. Are you referring to the init process, or the init (system) command? There appears to be a distinction (Unix for Advanced Users - The Unix Boot Sequence - Starting init).

The web research that I did just now does not seem to say anything about init being able to cause idle processes to be forced to run, but maybe I missed something.
# 7  
Old 02-19-2008
Quote:
Originally Posted by System Shock
Question: why would you "commit" idle processes before benchmarking, when in real life whatever you are benchmarking would probably have to run when these idle process run?
Why? Reproducibility of results.

Generally, when you publish benchmarks, you do so running no other programs. You may also try to turn off many background services/processes/whatever.

You do this so that other people running your benchmark on the same hardware are more likely to get the same result as you.

The more stuff besides your actual benchmark that can possibly be running during benchmarking, the less reproducible your results become.

The exception to these comments are when you specifically want to see how your task runs on a loaded system of some kind, but this is less common.

If unix simply lacks the functionality that windows has in this area--fine. Idle tasks suddenly running in the middle of your benchmark is usually a rare event. Its certainly more important that you do obvious simple things like make sure that no other non-idle tasks are running. But having an api for committing idle tasks like windows does certainly is icing on the cake, as it can eliminate the rare possibility.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

give ldap a/c during commit in commit line section

Is someone help me to achieve my goal I am working on a script actually script is working fine .The goal of script is restrict the user for something like while he is doing tocommit in repository he will commit with comment and with some parameter....here I have one more requirement and that is... (0 Replies)
Discussion started by: anuragpgtgerman
0 Replies

2. Shell Programming and Scripting

Commit in PL/SQL using Shell script

Hi All, I have written a shell script in which i am updating records in a table. It is a PL/SQL block. I have to use PL/SQL block as i am using bms_application_info.set_module package But the problem is once the script completes, i cannot see the updated records in Table. I mean result is... (0 Replies)
Discussion started by: Amit.Sagpariya
0 Replies

3. Shell Programming and Scripting

db2 commit for every 50 rows

I am writing a unix shell script for the archive purge job. During purging, the records will be deleted one by one. I didnot mention anything about db2 commit. By default, the records are commited one by one. Now I need to give commit for every 50 records deletion. The deletion part is as... (0 Replies)
Discussion started by: kmanivan82
0 Replies

4. UNIX for Advanced & Expert Users

cvs[commit aborted]:'root is not allowed to commit changes'

Hi , can u please any one of you give solution for this .. when am tryring to commit files from the CVS in Myeclipse J2ee Environment . that i coundnt able to commit and getting the Following error message cvs :'root' is not allowd to commit files' am using redhat enterprise 5 Server . (1 Reply)
Discussion started by: rksubash
1 Replies

5. Shell Programming and Scripting

cvs diff then commit

I would like to run a cvs diff to check which files have been changed and then cvs commit these changed files. Does anyone have a shell script which will automate this process? (1 Reply)
Discussion started by: alangibson
1 Replies

6. AIX

commit

good morning Can you explain to me what is a "commit" (aix 5.3) ? There is no man for this command. thank you (1 Reply)
Discussion started by: pascalbout
1 Replies

7. SCO

Scheduled tasks in SCO Unix 5.0.5

Hi. Am a unix 5.o.5 user. I need to schedule a program to be running everyday at 12 midnight. How do i proceed. I need help. Also what is the maximum size that sco unix can conveninetly handle. I keep getting this message. "Filesystem greater than device which it is curently located. Pls backup... (2 Replies)
Discussion started by: uzomaok
2 Replies

8. SCO

Identifiy and Kill Idle Unix(SCO) Process called externally

Hi, Please let us know of any possiblity of identifying and killing unix proces invoked externally (by an external tool which does not create a session). 'who' command gives idle time of sessions. But what we are looking for is idle time of a process. 'ps' command gives the elapsed/running... (1 Reply)
Discussion started by: vbalajis
1 Replies
Login or Register to Ask a Question