Thread View: comp.sys.transputer
1 messages
1 total messages
Started by ANDY RABAGLIATI
Wed, 30 Jan 1991 17:27
Sources of extraordinary link handling libraries
Author: ANDY RABAGLIATI
Date: Wed, 30 Jan 1991 17:27
Date: Wed, 30 Jan 1991 17:27
234 lines
6761 bytes
6761 bytes
Someone requested the sources of the extraordinary link handling
library. These sources come with all the disclaimers our
medicine man could think of, including the acknowledgement that
they *DEPEND* on knowledge of how the compiler schedules
processes.
If you wish to cut them down to be leaner and meaner, it may
easily be possible. If they fail to work, I refer you again to
our medicine man, who is busy at the moment conjuring up chemical
warfare antidotes from sodom apples.
Cheers, Andy Rabagliati EMAIL:- rabagliatia@isnet.inmos.COM
Here it is:
------------------------------------------------------------------------
--- xlink0.occ --- xlink0.occ --- xlink0.occ ---
#OPTION "E W" -- no compiler libs, full GUYs
#COMMENT "Extraordinary link handling library, V1.0 31/10/88"
#COMMENT "(c) Copyright INMOS Limited 1988"
PROC Reinitialise (CHAN OF ANY c)
SEQ
GUY
LDLP c
RESETCH
MINT
DIFF
CJ .OK
SETERR
:OK
:
--- xlink1.occ --- xlink1.occ --- xlink1.occ ---
#OPTION "E W" -- no compiler libs, full GUYs
#COMMENT "Extraordinary link handling library, V1.0 31/10/88"
#COMMENT "(c) Copyright INMOS Limited 1988"
PROC InputOrFail.t(CHAN OF ANY c, []BYTE mess, TIMER t, VAL INT time,
BOOL aborted)
-- modified to be wordlength-independant 2-dec-87
VAL NotProcess.p IS MOSTNEG INT :
CHAN OF BOOL completed :
--{{{ order of execution is essential
-- The order of execution of the components of this PAR is
-- important. If the communication on c is not started before the
-- ALTernative it is possible for c to be reset before it is used.
-- In this case the process can fail to terminate if the communication
-- on c fails.
--}}}
PAR
--{{{ execute this component first
SEQ
c ? mess
completed ! TRUE
--}}}
--{{{ execute this component second
BOOL sink :
ALT
t ? AFTER time
INT pid :
SEQ
--{{{ reset the channel
GUY
LDLP c
RESETCH
STL pid
--}}}
--{{{ run the process if pid is valid
IF
pid = NotProcess.p
SKIP
TRUE
SEQ
GUY
LDL pid
RUNP
--}}}
completed ? sink
aborted := TRUE
completed ? sink
aborted := FALSE
--}}}
:
--- xlink2.occ --- xlink2.occ --- xlink2.occ ---
#OPTION "E W" -- no compiler libs, full GUYs
#COMMENT "Extraordinary link handling library, V1.0 31/10/88"
#COMMENT "(c) Copyright INMOS Limited 1988"
PROC InputOrFail.c(CHAN OF ANY c, []BYTE mess,CHAN OF INT kill, BOOL aborted)
-- modified to be wordlength independant 2-dec-87
VAL NotProcess.p IS MOSTNEG INT :
CHAN OF BOOL completed :
--{{{ order of execution is essential
-- The order of execution of the components of this PAR is
-- important. If the communication on c is not started before the
-- ALTernative it is possible for c to be reset before it is used.
-- In this case the process can fail to terminate if the communication
-- on c fails.
--}}}
PAR
--{{{ execute this component first
SEQ
c ? mess
completed ! TRUE
--}}}
--{{{ execute this component second
ALT
INT sink :
kill ? sink
INT pid :
SEQ
--{{{ reset the channel
GUY
LDLP c
RESETCH
STL pid
--}}}
--{{{ run the process if pid is valid
IF
pid = NotProcess.p
SKIP
TRUE
SEQ
GUY
LDL pid
RUNP
--}}}
BOOL sink :
completed ? sink
aborted := TRUE
BOOL sink :
completed ? sink
aborted := FALSE
--}}}
:
--- xlink3.occ --- xlink3.occ --- xlink3.occ ---
#OPTION "E W" -- no compiler libs, full GUYs
#COMMENT "Extraordinary link handling library, V1.0 31/10/88"
#COMMENT "(c) Copyright INMOS Limited 1988"
PROC OutputOrFail.t(CHAN OF ANY c, VAL []BYTE mess, TIMER t,
VAL INT time, BOOL aborted)
-- modified to be wordlength independant 2-dec-87
VAL NotProcess.p IS MOSTNEG INT :
CHAN OF BOOL completed :
--{{{ order of execution is essential
-- The order of execution of the components of this PAR is
-- important. If the communication on c is not started before the
-- ALTernative it is possible for c to be reset before it is used.
-- In this case the process can fail to terminate if the communication
-- on c fails.
--}}}
PAR
--{{{ execute this component first
SEQ
c ! mess
completed ! TRUE
--}}}
--{{{ execute this component second
BOOL sink :
ALT
t ? AFTER time
INT pid :
SEQ
--{{{ reset the channel
GUY
LDLP c
RESETCH
STL pid
--}}}
--{{{ run the process if pid is valid
IF
pid = NotProcess.p
SKIP
TRUE
SEQ
GUY
LDL pid
RUNP
--}}}
completed ? sink
aborted := TRUE
completed ? sink
aborted := FALSE
--}}}
:
--- xlink4.occ --- xlink4.occ --- xlink4.occ ---
#OPTION "E W" -- no compiler libs, full GUYs
#COMMENT "Extraordinary link handling library, V1.0 31/10/88"
#COMMENT "(c) Copyright INMOS Limited 1988"
PROC OutputOrFail.c(CHAN OF ANY c, VAL []BYTE mess, CHAN OF INT kill,
BOOL aborted)
-- modified to be wordlength independant 2-dec-87
VAL NotProcess.p IS MOSTNEG INT :
CHAN OF BOOL completed :
--{{{ order of execution is essential
-- The order of execution of the components of this PAR is
-- important. If the communication on c is not started before the
-- ALTernative it is possible for c to be reset before it is used.
-- In this case the process can fail to terminate if the communication
-- on c fails.
--}}}
PAR
--{{{ execute this component first
SEQ
c ! mess
completed ! TRUE
--}}}
--{{{ execute this component second
ALT
INT sink :
kill ? sink
INT pid :
SEQ
--{{{ reset the channel
GUY
LDLP c
RESETCH
STL pid
--}}}
--{{{ run the process if pid is valid
IF
pid = NotProcess.p
SKIP
TRUE
SEQ
GUY
LDL pid
RUNP
--}}}
BOOL sink :
completed ? sink
aborted := TRUE
BOOL sink :
completed ? sink
aborted := FALSE
--}}}
:
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads