home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / utilities / utilss / slofilter / !ReadMe1st < prev    next >
Text File  |  1993-02-21  |  5KB  |  107 lines

  1. Slow Filter
  2. ===========
  3.  
  4. This is a demonstration of an idea to allow the user to reduce the number
  5. of NULL polls recieved by a task - this is intended to slow down the rate
  6. at which a backgrounded task runs, so that more NULLs will be available
  7. for other background tasks.
  8.  
  9. It works by using a RISC OS 3 filter which only lets occasional NULL events
  10. through to the affected application. By letting more or less NULLs through,
  11. it is therefore possible to regulate the speed at which background (NULL)
  12. processes proceed. Note that this has no effect on the timeslice taken
  13. by an application for backgrounded tasks, however.
  14.  
  15. The example used here is a desktop clock which redraws its time every NULL
  16. poll, and thus chews through background bandwidth which could be put to more
  17. profitable use by other applications.
  18.  
  19. To make it easy to spot, each time the clock is redrawn, the background
  20. colour is changed (it's a flashy clock ;-)
  21. (sorry!)
  22.  
  23. Double-click the !BadClock application to run it as normal. A flashing clock
  24. display (and an ugly one at that) should appear on the right side of the
  25. iconbar.
  26.  
  27. (Wait for a couple of seconds, as the clock fills its taskname with the
  28.  time it started up, so you'll be able to distinguish them more easily)
  29.  
  30. Double-click the !GoSlow obey file to run it with an attached filter which
  31. gives it no more than 2 NULLs per second.
  32.  
  33. This has the nasty effect of redrawing the screen for some reason, but bear
  34. with us! It will also beep. Do not be concerned.
  35.  
  36. Another clock should appear next to the first, but will update 2 times
  37. a second at most.
  38.  
  39. The clocks can be killed using the Task Window's QUIT option.
  40.  
  41. To try the filter out on other programs for yourself, simply double click
  42. the BASIC program 'SlowFilter', and then run the program you wish
  43. to be slowed. (SlowFilter affects the next application that is run)
  44. Note that SlowFilter beeps when it attaches a filter to another application.
  45.  
  46.  
  47. Notes
  48. =====
  49.  
  50. The filter works as expected.
  51.  
  52. If you try it on !Draw, you can make drag updates (e.g. line drawing) only
  53. update once every 1/2 second, while other non-NULL event activities
  54. (entering some text) are unaffected. (Obviously this is of little use, so
  55. the user would be pretty stupid to apply the filter to Draw, but it makes
  56. a reasonable example to try it out on)
  57.  
  58. There is however, one problem that I have noticed:
  59.   In !Draw, if you have NULL events in use (for a drag, etc) AND you try to
  60.   open a dbox window (saveas, "modified file" dbox, etc), the window is
  61.   immediately closed by the RISC OS Lib dbox() functions.
  62.  
  63.   I have 3 points to make about this:
  64.   * It goes away again if you can cancel the drag (i.e. if you are entering
  65.     a line/curve path, double-click to finish it or go back into 'select'
  66.     mode, and the dboxes work fine again)
  67.  
  68.   * This is the sort of problem that can be avoided by NOT trying to
  69.     slow such an application. There is absolutely no logical reason to
  70.     slow Draw anyway, so it not working properly here isn't a big problem.
  71.  
  72.   * I think the problem is due to me giving draw an event (event type 42)
  73.     which it can't handle, and dbox assumes it is 'dangerous' and closes
  74.     the window. Probably, if this event were changed to a 17 (message)
  75.     and a safe (allocated, and defined to have no meaning) message given,
  76.     nullifying NULL events would be more harmless than changing them into
  77.     other (potentially bad) event types.
  78.  
  79. The filter works fine with other programs that use NULLs (DSEdit II with it's
  80. continuous cursor updates, background tasks, real time spectrum, etc; !Edit
  81. while dragging to select text, etc)
  82.  
  83. Other than the problem in Draw, I can't make it do anything unexpected.
  84.  
  85. Oh, and it has no effect on file drags if they are done via DragASprite, as
  86. this is unrelated to the application which called it.
  87.  
  88.  
  89. IMPORTANT NOTES
  90. ===============
  91.  
  92. 1. This is experimental. Use at your own risk, etc. etc. Don't use while the
  93.    desktop has important things running!
  94.  
  95. 2. The filter is bunged in the RMA, and this memory is never released
  96.  
  97. 3. The filter is attached to a certain task, and will continue to affect
  98.    that task until you reset the machine - if you quit the task and run
  99.    another application, it is quite possinle it will happen to get the same
  100.    task handle, and will therefore also be affected.
  101.    i.e.  Reset the machine after playing about with this!
  102.  
  103. 4. The reason it won't work on your RISC OS 2 machine is that it's using
  104.    a feature only available in RISC OS 3! Should I have mentioned this before?
  105.  
  106. Jason Williams
  107.