[TUHS] Early Unix function calls: expensive?

scj at yaccman.com scj at yaccman.com
Wed Jan 6 06:26:44 AEST 2016

> Ah, this brings back memories.    We had this MACRO-11 concept called
> “threaded code” (not threads in the multiprocessing sense).
> Essentially we had very small code fragments that were loaded into a table
> and we’d run them to process data with very light JSR/RET linkage
> (minimal register saves).
> Getting back to Richie’s idea of lightweight functions, it indeed is a
> more maintainable style and perhaps ahead of it’s time when modern
> highly optimized inlining compilers came around it made it efficient
> without the programmer needing to wrap his head around it too much.
It brought back memories for me, too.  At Ardent, we had a 4-processor
system with each processor a vector processor.  We wanted to be able to go
between parallel and serial very quickly, and the key to achieving this
was to have all 4 threads share the stack.  So in the parallel sections,
all function calls had to be lightweight (only JSR/RET) and keep their
paws off some of the registers (including the stack pointer).  It worked
beautifully, giving us a 3.99 times speedup with 4 processors when we were
in its sweet spot.

More information about the TUHS mailing list