Discussion:
Recurring event with sub-sec. precision on V6 Unix
(too old to reply)
Seth Price
2021-04-30 16:33:31 UTC
Permalink
I'm writing a C program for V6 Unix in which I need to execute a function
at regular intervals with sub-second precision at or above 10 Hz.
The Line Time Clock *should* work for my purposes, but I'm not sure
whether using it directly would interfere with the OS itself.
Also, I'd prefer to keep this program self-contained and to not rely on
kernel modification.

Thanks in advance.
Lew Pitcher
2021-05-07 22:25:42 UTC
Permalink
Post by Seth Price
I'm writing a C program for V6 Unix in which I need to execute a function
at regular intervals with sub-second precision at or above 10 Hz.
The Line Time Clock *should* work for my purposes, but I'm not sure
whether using it directly would interfere with the OS itself.
Also, I'd prefer to keep this program self-contained and to not rely on
kernel modification.
According to the Lions book, the kernel already utilizes interrupts from the
LTC for process scheduling and accounting purposes. This makes it unsuitable
for direct use by application programs, and (according to your preferences)
would not be suitable for your use.

6th Edition Unix lacks the poll(2) or select(2) calls of the later versions of
Unix (notably BSD and System V). Were you to upgrade to one of those versions
from your 45-year-old OS, then you /could/ get sub-second delays (milliseconds
for poll(2), microseconds for select(2) ) in your application code. But, alas,
you are running (sic) V6 Unix.

Were you not running your Unix on a PDP/11, and instead upgraded to a more recent
system, you /might/ be able to write a kernel device driver to handle sub-second
timer interrupts, and give your code the response interval you seek. Again, alas,
but you are stuck on 50-year-old hardware, and this would not be an option for
you.

Perhaps you should look to an upgrade?

HTH
--
Lew Pitcher
"In Skills, We Trust"
Loading...