[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linrad] CPU usage
Hi All,
In the current Linrad package, the CPU spends its
surplus time in an "idle loop" which is just doing
nothing or sending the process to sleep with usleep();
depending on the parameters selected by the user in
the initial setup.
Just by comparing the time spent in the idle loop
to the total time one gets a good number for how much
of the time available to Linrad that could be used for
heavier processing.
In the multi-threaded version the above strategy is
not possible. Any time not needed by Linrad is consumed
by the kernel or another task. Instead a system call
getrusage() is used to get the total amount of time
that the CPU spent with the task. This works fine
with the 2.6 core and is how getrusage is defined
according to POSIX (whatever that is) but in the 2.4
and older kernels getrusage works differently. It
just gives the time consumed by the calling thread
and therefore all threads have to be interrogated.
This is fine in the development phase because it
allows me to see where the time is spent, but summing
over the fifteen threads which gives the correct load
under 2.4 kernels gives a value that is too big by 15
times under 2.6.
By setting a global define GETRUSAGE_OLD to 0 or 1
Linrad works fine under both kernels. Currently
a header file has to be edited manually, but I am sure
it is possibe to use the configure script to find out
which of the behaviours to implement at compile time.
Presumably it amounts to find the GCC version and make
a test on it to get a yes or no answer.
I just do not know how to do it. Is there anyone on the
list who knows? I do not understand anything about how
the configure script really works - someone made it for
me - so I really need a few lines to add to the Linrad
configure.in file to get an input to AC_SUBST.
73
Leif / SM5BSZ
#############################################################
This message is sent to you because you are subscribed to
the mailing list <linrad@xxxxxxxxxxxxxxxxxxxxx>.
To unsubscribe, E-mail to: <linrad-off@xxxxxxxxxxxxxxxxxxxxx>
To switch to the DIGEST mode, E-mail to <linrad-digest@xxxxxxxxxxxxxxxxxxxxx>
To switch to the INDEX mode, E-mail to <linrad-index@xxxxxxxxxxxxxxxxxxxxx>
Send administrative queries to <linrad-request@xxxxxxxxxxxxxxxxxxxxx>
LINRADDARNIL