P
pj
Hi,
I want to measure host loads (using system(uptime)) every 10 seconds
while I am running an application written in C, and write the host
load average during the application execution to a file right before
the application terminates.
i.e.,
--- Application is started
--- measure load average (using `uptime`) every 10 seconds
during the
execution
--- Application is terminated.
--- calculate the load average and print it out
My question is how can I run system(uptime) every 10 seconds during
the application execution using one processor machine? I was thinking
of having two threads, but the thread blocks the other until it is
terminated which is not what I want. I need to run two jobs (uptime
every 10 seconds and an application executable) simultaneously and
uptime should stop when the application is finished and print out the
average. thanks for any help in advance
I want to measure host loads (using system(uptime)) every 10 seconds
while I am running an application written in C, and write the host
load average during the application execution to a file right before
the application terminates.
i.e.,
--- Application is started
--- measure load average (using `uptime`) every 10 seconds
during the
execution
--- Application is terminated.
--- calculate the load average and print it out
My question is how can I run system(uptime) every 10 seconds during
the application execution using one processor machine? I was thinking
of having two threads, but the thread blocks the other until it is
terminated which is not what I want. I need to run two jobs (uptime
every 10 seconds and an application executable) simultaneously and
uptime should stop when the application is finished and print out the
average. thanks for any help in advance