• Recurring event with sub-sec. precision on V6 Unix

    From Seth Price@21:1/5 to All on Fri Apr 30 16:33:31 2021
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lew Pitcher@21:1/5 to Seth Price on Fri May 7 22:25:42 2021
    On Fri, 30 Apr 2021 16:33:31 +0000, Seth Price wrote:

    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"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)