Commit 439d92a
committed
Add experimental SUBR to call nanosleep() for experiments in reducing CPU load
This adds a SUBR, sb_YIELD, value (octal) 0322 which takes a single number
0..999999999 which is the number of nanoseconds to pass to nanosleep().
The return value is T if the call to nanosleep() was executed or NIL
if it was not (argument out-of-range, or other error in getting the
number from the argument).
To use this experimental SUBR in a sysout you should:
(SETQ \INITSUBRS (CONS '(YIELD #o322) \INITSUBRS))
then you can define functions that use that SUBR:
(DEFINEQ (BACKGROUND-YIELD (SUBRCALL YIELD 833333)))
(COMPILE 'BACKGROUND-YIELD)
(SETQ BACKGROUNDFNS (CONS 'BACKGROUND-YIELD BACKGROUNDFNS))1 parent c6a74b2 commit 439d92a
2 files changed
+17
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
194 | 196 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
779 | 780 | | |
780 | 781 | | |
781 | 782 | | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
782 | 797 | | |
783 | 798 | | |
784 | 799 | | |
| |||
0 commit comments