Re: Conversing with a tcl application...



jerry.levan@xxxxxxxxx wrote:
Hi,

I have written a small tcl app for my linux laptop that watches
/proc/interrupts. If the interrupt count for the keyboard, touchpad,
or mouse does not change within a specified ( currently hard coded)
interval, the program will do some house cleaning and then
"suspend" to memory. Subsequent keyboard or touchpad activity
will awake the computer from the sleep state. (If there was
an interrupt the "time to sleep" parameter is reset.)

The program is started at boot time and runs in the background.

It seems to work fine...

I would like to be able to control the "time to sleep" value from
an external program so I can do lengthy unattended operations without
worrying about the system going to sleep during the operation ie
burning a dvd.

The program wakes up every six seconds to check the counts and
take the appropriate action:
Reset the time to sleep ( an interrupt occurred since the last
check)
Suspend the computer ( no interrupts have occurred for the
specified time)
Decrease the time to sleep ( no interrupts have occurred and time
has not expired)

Any cool tclish way to have an external tcl/tk prog monitor and
modify the target app ( ie set the length of the max time to sleep
value)?

If you're using Tk you can use the send command. If you're only using
Tcl without Tk then just open a server socket. If you're worried about
people hacking into your box then don't accept connections from other
that 127.0.0.1.

.



Relevant Pages

  • Re: Conversing with a tcl application...
    ... If the interrupt count for the keyboard, touchpad, ... will awake the computer from the sleep state. ...
    (comp.lang.tcl)
  • Re: 8ms Timer for serial port access
    ... sleep has a grainularity of 10ms. ... and that's at the next 10ms interrupt. ... -scheduler runs as soon as the driver tasklett completes. ... Disable the FIFO on your UART so you get an interrupt for every byte. ...
    (comp.os.linux.development.apps)
  • Re: newbie delay/sleep question
    ... microseconds and then do some other task. ... another interrupt within that 100 microseconds and the sleep I've been ... receive the interrupt and queue them up on a tasklet or work/wait queue ...
    (comp.os.linux.development.system)
  • Re: [PATCH] Remove process freezer from suspend to RAM pathway
    ... When your hardware can put itself to sleep and atomically preserve memory as it does so, you don't need an atomic copy. ... Ensure that the other CPUs have finished any trailing interrupt handlers and put them to sleep ... After you've set the "no_bind" flag, you won't get any *new* subdevices trying to bind, therefore it's safe to iterate over the list of present sub-devices and suspend them. ... When all the leaf devices are off, the parent device can be turned off because everything waiting on the leaf devices is blocked on them and won't unblock until the parent device *AND* the leaf device are turned on again, in that order. ...
    (Linux-Kernel)
  • Conversing with a tcl application...
    ... If the interrupt count for the keyboard, touchpad, ... will awake the computer from the sleep state. ...
    (comp.lang.tcl)