next up previous contents index
Next: Hardware Assistance Up: Multitasking Previous: Token Threading   Contents   Index


Subroutine Threading

In Forth systems that use subroutine threading, a form of tokenization can be implemented by using doubly indexed indirect addressing so that subroutine calls are vectored through the active task's token table. If the compiler optimizes certain words as inline native instructions instead of subroutine calls, this will present a problem if it is desired to alter the behavior of these words by dynamic binding. If access to the compiler source code is possible, the words can be implemented as subroutines also, thereby eliminating the problem; otherwise, it may be possible to repackage these words in the manner described above for indirect threaded systems. If the compiler is particularly good at optimization, it may be smart enough to desubroutinize these repackagings and thwart our efforts. In this case, the implementation may have to forgo complete freedom of dynamic binding and restrict these words from being rebound.



Robert J. Brown
1999-09-26