It would be useful for daq to run setuid root so it
could raise its process priority when acquiring data.
Data loss doesn't appear to be a problem, but the INNER
loop can be choppy if there's contention for the CPU.
It's not as simple as raising priority. The internal
architecture of daq traces back to MS-DOS, which provided
little in the way of support for asynchrony. Daq busy-waits
for events, which makes it CPU-bound. Raising its priority
will starve all other applications on the machine. The main
loop in daq needs to be converted to use pthreads so it will
yield the CPU when not busy.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Leaving the comedi file descriptor in the default (blocking)
mode eliminates busy-waiting without (apparently) causing
other problems. This change (not including raising the
process priority) is in 3.11.4.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=124984
Information on setting effecitve UID is at
http://www.gnu.org/manual/glibc-2.2.5/html_node/Enable-Disable-Setuid.html#Enable%2fDisable%20Setuid
Logged In: YES
user_id=124984
It's not as simple as raising priority. The internal
architecture of daq traces back to MS-DOS, which provided
little in the way of support for asynchrony. Daq busy-waits
for events, which makes it CPU-bound. Raising its priority
will starve all other applications on the machine. The main
loop in daq needs to be converted to use pthreads so it will
yield the CPU when not busy.
Logged In: YES
user_id=124984
Setting the comedi file descriptor back to blocking may
alleviate the starvation problem.
Logged In: YES
user_id=124984
Leaving the comedi file descriptor in the default (blocking)
mode eliminates busy-waiting without (apparently) causing
other problems. This change (not including raising the
process priority) is in 3.11.4.