[Info-vax] KP threads
John Dallman
jgd at cix.co.uk
Thu Dec 23 15:14:00 EST 2021
In article <61c49505$0$702$14726298 at news.sunsite.dk>, arne at vajhoej.dk
(Arne Vajhøj) wrote:
> They have been mentioned a few times, so I decided to take a look.
>
> And I am puzzled.
>
> Normally (pthreads, Win32, Boost/C++11, Java, .NET etc.) threads are
> about starting a bunch of independent threads that does some work
> in parallel.
It looks to me, from a bit of PDF-searching, as if the VMS idiom for that
kind of threading is Kernel Threads, described in section 2.8 of VSI's
Programming Concepts manual.
> But when I look at EXE$KP_START, EXE$KP_STALL_GENERAL,
> EXE$KP_RESTART and EXE$KP_END then I do not see such capability.
>
> Instead it is easy to see how to do coroutines with two streams
> of execution but only one executing at a time transferring control
> forth and back between the two streams (pretty similar to Modula-2
> ISO COROUTINES TRANSFER).
I agree. The KP_ routines seem, looking at the explanation in Appendix C
of "Porting Applications from Alpha to IA64," to have been created to let
applications' internal coroutine systems work on IA-64. The hardware
stack implementation on that architecture is a lot more complicated than
VAX, or Alpha, or x86-64. It's fairly transparent if you use the stack
simplistically, but it isn't really designed for DIY coroutines, or other
clever trickery.
John
More information about the Info-vax
mailing list