Architectural enhancements for parallel computer systems utilizing encapsulation of queuing allowing small grain processing5485626Abstract An architecture uses a process, termed "encapsulation", by which queues and counters are only accessed through a special memory operand called "object storage". The system alone is in control of the object storage, and the user cannot access it directly at any time. If the user needs to access a queue, the user must request it from the system. The system will in turn provide such access by issuing the user a "token". This token is the only means of communication between the user and the requested queue. By providing threads to be dispatched to real processors without large operating overhead, through object storage, the operating systems do not need to wait for the system's dispatching process to complete. Operating systems can signal the system through the use of object storage that they are authorized to access the processor when needed and thus forego the long dispatching process. In addition, since real processors are not dedicated, they can execute other programs when not needed. Since the state of threads is unknown to the operating system and the object dispatcher is in charge, operating support is kept at a minimum, which in itself is an important advantage of the invention. The encapsulation process along with the queuing system used in the architecture lead to finer granularity. Claims What is claimed is: Description BACKGROUND OF THE INVENTION
__________________________________________________________________________
Thread Dispatching Element (TDE)
BYTEs
BITs
Description
__________________________________________________________________________
0-1 Descriptor:
0-3 Version
4 = 0 The Normal dispatching queue is empty (no TDEs)
= 1 The Normal dispatching queue has one or more TDEs enqueued
5 = 0 The Empty Event queue is empty (no TDEs)
= 1 The Empty Event queue has one or more TDEs enqueued
6 = 0 The Resumption Event queue is empty (no TDEs)
= 1 The Resumption Event queue has one or more TDEs enqueued
7 = 0 The More Work Event queue is empty (no TDEs)
= 1 The More Work Event queue has one or more TDEs enqueued
8-15
unused
2-3 unused
4-7 Short Waiters Count: The number of SRCs which have their short
wait descriptor bit set and which currently have one or more
waiting
TDEs. Initial value is 0.
8-11 Normal TDE Queue: Pointer to the first dispatchable TDE (Bit 4
of
the descriptor = 1 if a TDE is enqueued).
12-15 Empty Event TDE Queue: Pointer to the first event
TDE (Bit 5 of the
descriptor = 1 if a TDE is enqueued).
16-19 Resumption Event TDE Queue: Pointer to the first event TDE (Bit
6
of the descriptor = 1 if a TDE is enqueued).
20-23 More Work Event TDE Queue: Pointer to the first event TDE (Bit 7
of the descriptor = 1 if a TDE is enqueued).
24-31 Parent TDQ address (optional): The TDQ which is to be dispatched
if this TDQ runs out of work.
__________________________________________________________________________
A TDE is used to identify an executable piece of code and the attributes (e.g., priority, register contents) associated with it. TDEs may be explicitly created using the EQTDE (Enqueue Thread Dispatching Element) instruction or implicitly as the result of a send or receive type instruction. A TDE is used to store or load the current state at the time of a thread switch. The TDE for a particular thread can appear on a Thread Dispatching Queue (TDQ) or can be enqueued to an SRQ (Thread Send/Receive Queue) or SRC (Thread Send/Receive Counter) wait list. If a thread is eligible for instruction execution (thread dispatching), the associated TDE appears on a TDQ. If a program attempts to reference an invalid TDE (in a DQTDE (Dequeue Thread Dispatch Element) instruction), a specification exception occurs. The format of the TDE may be as follows: ##STR2##
__________________________________________________________________________
Thread Send/Receive Queue (SRQ)
BYTEs
BITs
Description
__________________________________________________________________________
0-1 Descriptor
0-3 Version
4 = 0 This is the last TDE on the chain
= 1 This is NOT the last TDE on the chain
5-6 reserved = 00
7 Fixed/Removable TDE:
= 1 Fixed. This TDE is not removed from the event/normal queue
when the specified event (below) occurs or the TDE is
dispatched.
= 0 Removable. This TDE is removed from the event/normal queue
when the specified event (below) occurs or the TDE is
dispatched.
8-11
Event Control: The event control bits are used by the EQTDE
instruction when the TDE is being enqueued to a TDQ. All TDEs
enqueued to an SRC or an SRQ must have event control specified
as
"normal" ( = 0000) or else a specification exception occurs.
They
control whether the TDE is placed on the normal queue or one of
the
seventy queues:
= 0000 Normal. The TDE is to be enqueued to the normal
(dispatchable) TDE queue. These TDEs are ready to be dispatched.
= 0001 Empty event. This TDE is to be made dispatchable when
the when there is an attempt to dispatch an empty TDQ (Normal
queue is empty).
= 0011 Resumption event. This TDE is to be made dispatchable
when the TDQ (`Normal` TDE queue) goes from empty to
non-empty.
= 0110 More Work event. This TDE is to be made dispatchable
when a TDE is added to the TDQ (`Normal` TDE queue).
TDEs are enqueued to the event queues in priority order. There
may be many "removable" event TDEs for a given event condition,
or one "fixed" TDE, but not both. When the specified event
occurs
the event TDE is "triggered". If it is a fixed TDE, the TDE
content
is copied and the copied TDE is placed on the normal
(dispatchable)
queue. If, however, it is a removable TDE, the TDE is moved to
the
normal (dispatchable) queue. Multiple TDEs may be placed on the
dispatchable queue as part of a single operation. For example, if
N
TDEs are placed on the dispatchable queue, up to N event TDEs
(fixed or removable) may also get placed on the dispatchable
queue.
(Note, for fixed events, copies of the events are created and
placed
upon the dispatchable queue.) The placement of event TDEs on the
dispatchable queue do not themselves cause other events to be
triggered. This is true for both fixed and removable events. All
event
TDEs are placed on the dispatchable queue BEFORE any of the
triggering TDEs if they are of the same priority. The Resumption
and
More Work events are overlapping conditions. If there are event
TDEs for both the resumption event is triggered. If only a More
Work event is specified, then that is triggered when the normal
queue
goes from empty to non empty. When and event TDE is placed on
the normal queue, the event control is set to normal (`0000`B).
12-15
reserved = 0000
2-6 State Flags Vector - The saved state: (The PSW is always saved).
0 = 1 GPRs
1 = 1 Access Registers
2 reserved (0)
3 = 1 Floating Point Registers
4 = 1 Vector Registers and Status Register
5 = 1 Vector Mask Register
6-15
reserved (0)
16-31
= 1 CR0-CR16 (defined CRs only)
32-39
reserved (0)
7 TDE Priority: - 8-bit unsigned.
The priority assigned to a TDE when enqueued to a TDQ (the
priority is ignored when a TDE is enqueued to an SRC or an SRQ -
the priority is taken from the SRC or SRQ.)
The highest priority is zero. TDEs are enqueued in priority
sequence,
last within the same priority, when moved to the TDQ (all TDEs
on
an SRQ or SRC are of the same priority).
8-11 Next TDE pointer (if any): If this is the last TDE on the chain,
descriptor bit 4 = 0.
16-23 Current queue pointer: Address of the TDQ to which this TDE is
enqueued.
24-31 reserved
32-xx Save Area: (For items specified in the State Flags Vector - when
presented on input (e.g., EQTDE) or output (e.g., MTTDE) the
items specified in the State Flags Vector are in ADJACENT
storage
locations (no holes for unselected items). Thus, the offset to
any
specific set of items depends upon the prior items specified in
the
State Flags Vector):
32-35 Instruction Address
GPR Contents - Regs 0 through 15.
Access Register Contents - Regs 0 through 15.
Floating Point Register Contents - Regs 0 through 4.
Vector and Status registers
Vector Mask Register
Control Registers
__________________________________________________________________________
An SRQ is an object used to exchange information between threads and to synchronize the transfer of control between threads. One thread can communicate with another thread by issuing a send type instruction to an SRQ or an SRC. Another thread can then obtain the information from the queue or counter by issuing a receive type instruction. These facilities are useful as a basis for many forms of efficient inter-thread communication and synchronization. Thread synchronization is provided by using Thread Send/Receive Messages and an SRQ in the following manner. When the active thread issues a Receive Message instruction and the target SRQ either (1) has no messages or (2) has no message which satisfies the search argument for the Receive Message instruction, the thread does not proceed. Instead, the thread is placed in the receive wait state by saving its state in a TDE and enqueuing it onto the wait list of the target SRQ. The thread dispatcher is then invoked to determine the next thread to be activated from the associated TDQ of the SRQ. The State Flags Vector of the SRQ defines the state to be saved whenever the TDE is put into wait on the SRQ. These flag values are copies to the TDE when the state is saved so that when the TDE is dispatched, the state which must be restored is known. Send and receive type operations are executed explicitly as instructions by threads and also be microcode functions. If a program attempts to reference an invalid SRQ, a specification exception occurs. The format of the SRQ header my be as follows: ##STR3##
__________________________________________________________________________
Thread Send/Receive Message (SRM)
BYTEs
BITs
Description
__________________________________________________________________________
0-1 Descriptor
0-3 Version
4 = 0 The SRQ has no waiting TDEs.
= 1 The SRQ has one or more waiting TDEs.
5 = 0 The SRQ has no SRMs (Thread Send/Receive Messages)
= 1 The SRQ has one or more SRMs
6 reserved (0)
7 Dispatch Control Option:
= 0 All TDEs are moved to the associated TDQ when the waiting
TDEs are to be dispatched.
= 1 Only the first TDE is moved to the associated TDQ when the
waiting TDEs are to be dispatched.
8-15
Message Type: Specifies the type of register(s) from/to which
the
message Information is taken/placed (only the following values
are
valid):
= 00x No message information (only priority).
= 01x From/to a GPR.
= 02x From/to an even/odd GPR pair.
= 04x From/to an AR/GPR pair.
= 08x From/to an FPR.
2-6 State Flags Vector - State to be saved. (The PSW is always
saved.)
0 = 1 Save the GPRS.
1 = 1 Save the Access Registers
2 = Reserved (0)
3 = 1 Save the Floating Point Registers
4 = 1 Save the Vector Registers and Status Register
5 = 1 Save the Vector Mask Register
6-15
Reserved (0)
16-31
= 1 Save CR0-CR16 (defined CRs only)
32-39
Reserved (0)
7 TDE Priority: - 8-bit unsigned. The priority assigned to a TDE
when
enqueued to a TDQ (the priority is ignored when a TDE is
enqueued
to an SRC or an SRQ - the priority is taken from the SRC or
SRQ.)
The highest priority is zero. TDEs are enqueued in priority
sequence,
last within the sane priority, when moved to the TDQ (all
TDEs on an
SRQ or SRC are of the same priority).
8-15 Associated TDQ: The address of the TDQ where waiting
TDEs are to
be enqueued when they are to be moved to the TDQ.
16-19 First waiting TDE Pointer: (If no TDEs are waiting,
descriptor bit 4 =
0.)
20-23 First Thread Send/Receive Message: (If no SRMs are enqueued,
descriptor bit 5 = 0.)
__________________________________________________________________________
When a Send Message (SENDM) or Enqueue Message (EQM) instruction is executed, the information placed on the SRQ is referred to as a Thread Send/Receive Message (SRM). An SRM is not a separately created and addressable object like the others defined here. SRMs are dynamically "created" as a result of a SENDM or EQM and are "removed" from the SRQ when the information is retrieved using a Receiver Message (RECM) or Dequeue Message (DQM) instruction. The message information is extracted from the specified register or registers when the message is placed on an SRQ and placed in the specified register or registers when the message is retrieved from the SRQ. The register number or numbers are specified in the SENDM, EQM, RECM, or DQM instructions, but the register type (e.g., General Purpose Register (GPR), Access Register (AR), Floating Point Register (FPR)) is specified when the SRQ is created. In essence, this allows for register-to-register communications between threads. The SRM has a priority and contains a "message", which may often be a pointer to information in addressable storage. The storage for SRMs can be dynamically allocated from object storage. The format of the SRM may be as follows: ##STR4##
__________________________________________________________________________
Thread Send/Receive Counter (SRC)
BYTEs
BITs
Description
__________________________________________________________________________
0-1 Descriptor
0-3 Unused
4 = 0 This is the last SRM on the chain
= 1 This is not the last SRM on the chain
5-15
unused
2-6 unused
7 Message Priority - 8 bit unsigned.
8-11 Next SRM Message Address (if any): (If no additional SRMs are
enqueued, descriptor bit 4 = 0.)
12-xx Message: The required size of the message area is determined by
the
size of the registers being copied here.
__________________________________________________________________________
An SRC is a thread object used in much the same way as an SRQ except that no messages are enqueued. Instead, a Send Count (SENDC) instruction causes the count field in the SRC header to be incremented. A Receive Count (RECC) instruction may cause the count to be decremented. The State Flags Vector of the SRC defines the state to be saved whenever a TDE is put into wait on the SRC. These flag values are copies to the TDE when the state is saved so that when the TDE is dispatched, the state which must be restored is known. If the program attempts to reference an invalid SRC, a specification exception occurs. The format of the SRC may be as follows: ##STR5##
__________________________________________________________________________
Storage Allocation and Addressing
BYTEs
BITs
Description
__________________________________________________________________________
0-1 Descriptor
0-3 Version
4 = 0 The SRC has no waiting TDEs.
= 1 The SRC has one or more waiting TDEs.
5 unused
6 = 0 The SRC has no "owner" (is not locked).
= 1 The SRC has an "owner".
7 Dispatch Control Option:
= 0 All TDEs are moved to the associated TDQ when the waiting
TDEs are to be dispatched.
= 1 Only the first TDE is moved to the associated TDQ when the
waiting Toes are to be dispatched.
8 Short Wait Option: Certain high-level synchronizing constructs
such as
barriers, DOACROSS, etc. may cause threads to wait for very
short
periods. This bit allows the machine to know when such situations
may
occur and to possibly optimize their operation.
= 0 Normal mode - TDEs in wait on this SRC may be in wait for a
long period.
= 1 TDEs in wait on this SRC are expected to be in wait for only
a
very short period before the wait will be satisfied.
9-15
Reserved (0)
2-6 State Flags Vector - State to be saved. (The PSW is always
saved.)
0 = 1 Save the GPRs.
1 = 1 Save the Access Registers
2 Reserved (0)
3 = 1 Save the Floating Point Registers
4 = 1 Save the Vector Registers and Status Register
5 = 1 Save the Vector Mask Register
6-15
Reserved (0)
16-31
= 1 Save CR0-CR16 (defined CRs only)
32-39
Reserved (0)
7 TDE Priority: - 8 bit unsigned. The priority assigned to a TDE
when
enqueued to a TDQ (the priority is ignored when a TDE is
enqueued
to an SRC or an SRQ - the priority is taken from the SRC or
SRQ.)
The highest priority is zero. TDEs are enqueued in priority
sequence,
last within the same priority, when moved to the TDQ (all TDEs on
an
SRQ or SRC are of the same priority).
8-15 Associated TDQ - The address of the TDQ where waiting TDEs are
to
be enqueued when they are to be moved to the TDQ.
16-19 Limit Value - 32-bit integer.
20-23 Count Value - 32-bit integer.
24-27 First waiting TDE Pointer: (If no TDEs are waiting, descriptor
bit 4 =
0.)
28-31 Owner: (Bit 6 = 0 if not owned - unlocked.) When an SRC is
"locked" by a RECC instruction, it may place a value in this
field.
When it is "unlocked" by a SENDC instruction, bit 6 of the
descriptor
is set to 0 indicating that it is unlocked. This may be used for
debugging deadlock situations.
__________________________________________________________________________
The objects defined above are unique in that when they are created using the defined create instructions, they are "encapsulated" by the machine. When an object is created, the create instruction returns "an address" into the "object space" which can be used by the instructions defined below to reference the object. Objects do not "reside" in regularly addressable memory and cannot be referenced using regular instructions with references to memory. The address returned has the following architectural properties: i. It is "associated" with the address space which would have been referenced had the address been used to reference memory. In a distributed system, a node reference would be included with the address space identity. One can therefore talk of the objects associated with an address space. The PURGE instruction can be used to destroy all objects associated with an address space. ii. The associated address space must exist and be authorized to the issuer of the instruction or else an object reference causes an addressing exception. iii. If control registers (CRs), access registers (ARs) or other mechanisms are used to control the address spaces which may be referenced, they likewise control accessibility to objects associated with an address space. For example, with access registers, the user must set the content of the access register to control the address space with which a created object will be associated. iv. Just as the user can "construct" memory addresses, the user can construct object addresses, but these can only be used to reference valid (created) objects associated with an address space to which the user has access. v. If an address is used to reference an invalid object (destroyed or not yet created), a specification exception occurs. vi. Address values may be reused. That is, if an address is returned on a create, then following a destroy, the same address value may be reused. vii. The actual number of objects which can exist at any given time is model dependent and may be extracted from the machine using a diagnostic function. This approach provides object integrity by preventing inappropriate access and yet, potentially, very fast access to system controlled storage. Because the user does not see the actual mechanisms used to represent the object, the implementation may be changed without affecting the user. Even synchronization among threads in loosely coupled systems may be supported with this interface if the implementation mechanisms are provided. Thread Dispatching The dispatching of threads is handled by a machine function known as the thread dispatcher. The thread dispatcher is invoked implicitly by the send/receive type instructions and explicitly by the Dispatch Thread Dispatching Queue instruction. It is the responsibility of the thread dispatcher to determine which thread should be dispatched next and to accomplish the thread switch. The status of the new thread is taken from the next thread's TDE. The primary object associated with the thread dispatching function is the TDQ. TDEs which are available to be dispatched are placed on a TDQ and are usually dequeued (i.e., the TDE storage is freed) by the thread dispatcher when they are dispatched. However, if the "Fixed" option of the TDE is on, the TDE is not removed after dispatching. The thread dispatcher is invoked when any of the following conditions occur: i. A send operation (message or count) occurs and there are TDEs on the TDQ of a higher priority than those placed on the TDQ by the send operation. These higher priority TDEs may be due to "more work" or "resumption" event TDEs. In this case, the state of the currently running thread is saved in a TDE which is placed on the TDQ at the same priority as those from the SRQ or SRC. ii. A receive operation (message or count) occurs and the receive is not satisfied. In this case, the current state is saved in a TDE which is placed on the SRC or SRQ wait list by the receive operation. iii. The thread dispatcher is explicitly invoked with the Dispatch Thread Dispatching Queue (DTDQ) instruction. In all three cases, the top TDE on the TDQ will be dispatched. For the second and third cases, the TDQ may be empty. If the TDQ is empty, the following happens: i. If the TDQ has any short wait SRCs, then the processor waits for the short wait to be satisfied or until the timeout occurs. ii. If there are no short wait SRCs or the timeouts elapse, the "empty TDQ" event TDE, if any, is dispatched. iii. If there is no "empty TDQ" event TDE and there is a parent TDQ, then the parent TDQ is dispatched. iv. If there is no "empty TDQ" event TDE and no parent TDQ, a TDQ Empty Exception (program) is signaled. The second situation means that the thread dispatcher has run out of work. The programming system should place an "empty TDQ" event TDE on the TDQ to handle this situation. It will thus be dispatched when there are no more TDEs to be dispatched. This TDE can be used to define whatever actions the programming system wishes, including the use of system services to place the system dispatchable unit (MVS task, VM virtual processor, etc.) into a system wait. This TDE may be a fixed TDE if multiple tasks will attempt to access the TDQ. Other events may be defined to help manage the dynamic work load. Thread dispatching can only occur among threads which are logically executing one of the threading instructions. This is unlike system dispatching and can occur at any arbitrary point in a program's execution. Threading Instructions All the instructions are architected as non-interruptable, since it is an objective of the invention to provide high performance access to these objects. Although it is logically feasible to interrupt operations which are in progress and block the initiation of other operations, the preferred implementation of the invention does not do this since it might cause the queue to be inaccessible by other threads for an indeterminate period. In other words, other threads should never see an SRQ or SRC as "busy" or inaccessible; however, processors in a multi-processor system may find objects inaccessible for short period of time. On a system with multiple processors, instruction execution must architecturally give the appearance that only one processor at a time is operating on an object, or group of objects, involved in the operation (i.e., object and instruction atomicity). This does not prevent the implementation from overlapping operations on objects so long as the appearance of atomicity is maintained. Some operations may require access to more than one object (e.g., moving TDEs from an SRQ to the associated TDQ). The implementation must ensure the consistency of all the objects involved and also that deadlocks do not occur. The architecture is defined such that deadlock-free operation can be guaranteed and the implementation can use a simple locking hierarchy. The threading instructions are as follows: Create Thread Send/Receive Counter (CRSRC)--This instruction creates a Thread Send/Receive Counter (SRC), and its token is returned in the register designated by the first operand. The second operand contains the address of a location in storage which defines the SRC to be created. The limit value of the counter is set to the value specified by the limit specification. This value is treated as an unsigned binary integer. If no SRCs are allocated, a program check exception occurs. ##STR6## Operation: An SRC is created and its token is returned in the register designated by operand 1. The second operand must contain the address of a location in storage which defines the SRC to be created:
__________________________________________________________________________
BYTEs
BITs
Description
__________________________________________________________________________
0-1 Descriptor
0-3 Version (only '0001"B allowed)
4-6 Reserved = 000
7 Dispatch Control Option:
= 0 All TDEs are moved to the associated TDQ when the waiting
TDEs are to be dispatched.
= 1 Only the first TDE is moved to the associated TDQ when the
waiting TDEs are to be dispatched.
8 Short Wait Option: Certain high-level synchronizing constructs
such as
barriers, DOACROSS, etc. may cause threads to wait for very
short
periods. This bit allows the machine to know when such situations
may
occur and to possibly optimize their operation.
= 0 Normal mode - TDEs in wait on this SRC may be in wait for a
long period.
= 1 TDEs in wait on this SRC are expected to be in wait for only
a
very short period before the wait will be satisfied.
9-15
Reserved (0)
2-6 State Flags Vector - State to be saved. (The PSW is always
saved.)
0 = 1 Save the GPRs.
1 = 1 Save the Access Registers
2 Reseraed (0)
3 = 1 Save the Floating Point Registers
4 = 1 Save the Vector Registers and Status Register
5 = 1 Save the Vector Mask Register
6-15
Reserved (0)
16-31
= 1 Save CR0-CR16 (defined CRs only)
32-39
Reserved (0)
7 TDE Priority: - 8-bit unsigned. The priority assigned to a TDE
when
enqueued to a TDQ (the priority is ignored when a TDE is
enqueued
to an SRC or an SRQ - the priority is taken from the SRC or
SRQ.)
The highest priority is zero. TDEs are enqueued in priority
sequence,
last within the same priority, when moved to the TDQ (all TDEs on
an
SRQ or SRC are of the same priority).
8-15 Associated TDQ - The address of the TDQ where waiting TDEs are
to
be enqueued when they are to be moved to the TDQ.
16- 19 Limit Value - 32-bit integer.
__________________________________________________________________________
The limit value of the counter is set to the value specified by the limit specification. This value is treated as an unsigned binary integer. The initial count value is set to zero. The count is treated as an unsigned binary 32 bit integer. The long/short wait option specification may be used by the implementation to optimize its operation. If no SRCs can be allocated, a Program Check exception occurs. Condition Code: Unchanged. Boundary Requirements: None. Program Exceptions: Addressing (no SRCs available, no associated address space) Specification (invalid associated TDQ specified, invalid version number, invalid State Flags Vector). Cream Thread Send/Receive Queue(CRSRQ)--This instruction creates an SRQ, and its address is returned in the register designated by the first operand. The second operand contains the address of a location in storage which defines the SRQ to be created. If no SRQs can be allocated, a program check exception occurs. ##STR7## Operation: An SRQ is created and its token is returned in the register designated by operand 1. The second operand must contain the address of a location in storage which defines the SRQ to be created:
__________________________________________________________________________
BYTEs
BITs
Description
__________________________________________________________________________
0-1 Descriptor
0-3 Version Number (only `0001`B allowed)
4-6 Reserved (0)
7 Dispatch Control Option:
= 0 All TDEs are moved to the associated TDQ when the waiting
TDEs are to be dispatched.
= 1 Only the first TDE is moved to the associated TDQ when the
waiting Toes are to be dispatched.
8-15
Message Type: Specifies the type of register(s) from/to which
the
message information is taken/placed (only the following values
are
valid):
= 00x No message information (only priority).
= 01x From/to a GPR.
= 02x From/to an even/odd GPR pair.
= 04x From/to an AR/GPR pair.
= 08x From/to an FPR.
2-6 State Flags Vector - State to be saved. (The PSW is always
saved.)
0 = 1 Save the GPRS.
1 = 1 Save the Access Registers
2 Reserved (0)
3 = 1 Save the Floating Point Registers
4 = 1 Save the Vector Registers and Status Register
5 = 1 Save the Vector Mask Register
6-15
Reserved (0)
16-31
= 1 Save CR0-CR16 (defined CRs only)
32-39
Reserved (0)
7 TDE Priority: - 8-bit unsigned. The priority assigned to a TDE
when
enqueued to a TDQ (the priority is ignored when a TDE is
enqueued
to an SRC or an SRQ - the priority is taken from the SRC or
SRQ.)
The highest priority is zero. TDEs are enqueued in priority
sequence,
last within the same priority, when moved to the TDQ (all TDEs
on
an SRQ or SRC are of the same priority).
8-15 Associated TDQ: The address of the TDQ where waiting TDEs are to
be enqueued when they are to be moved to the TDQ.
__________________________________________________________________________
If no SRQs can be allocated, a Program Check exception occurs. Condition Code: Unchanged. Boundary Requirements: None. Program exceptions: Addressing (no SRQs available, no associated address space) Specification (invalid associated TDQ specified, invalid version number, invalid State Hags Vector, Message Type (invalid message type, even register not specified for even/odd pair, invalid register number)) Create Thread Dispatching Queue(CRTDQ)--This instruction creates a TDQ, and its token is returned in the register designated by the first operand. The second operand contains the address of a location in storage which defines the TDQ to be created. ##STR8## Operation: A TDQ is created and its token is returned in the register designated by operand 1. The second operand must contain the address of a location in storage which defines the TDQ to be created:
______________________________________
BYTEs BITs Description
______________________________________
0-1 Descriptor
0-3 Version (only `0001`B allowed)
4-15 unused
______________________________________
Condition Code: Unchanged. Boundary Requirements: None. Program Exceptions: Addressing (no TDQs available, no associated address space) Specification (invalid version number) Dequeue Message (DQM)--This instruction dequeues an SRM (Thread Send/Receive Message) from the designated SRQ (Thread Send/Receive Queue). In operation, the SRMs on the SRQ are searched sequentially, starting with the first SRM, and the first SRM satisfying the search type is dequeued. ##STR9## Operation: The SRMs on the SRQ designated by the token in R2 are searched sequentially, starting with the first SRM. The search is controlled by the Priority designated by bits 24-31 of R4. The first SRM satisfying the Search type, designated by I3, is dequeued. The message is placed in the register designated by R1 and the actual priority of the message is placed in bits 24-31 of R4. The type of register (GPR, FPR, etc.) designated by R1 is determined from the Message Type of the SRQ. The meaning of the Search.sub.-- Type is:
______________________________________
BITs Description
______________________________________
0 Message Priority = Search.sub.-- Priority
1 Message Priority < Search.sub.-- Priority
2 Message Priority > Search.sub.-- Priority
______________________________________
The Search.sub.-- Type is the logical inclusive OR of the designated bits. For a Search Type of binary 000x, no priority will satisfy the search type, therefore, this combination is invalid. A specification exception occurs. For a Search.sub.-- Type of binary 111x, the first message is dequeued. If no message satisfies the Search.sub.-- Type, or if the message list is empty, R 1 (the message) and R4 (the priority of the message) are not altered. No thread dispatching is involved in a DQM.
______________________________________
Condition Code:
______________________________________
0 One or more messages remain after a successful dequeue
1 No messages remain after a successful dequeue
3 No message dequeued
______________________________________
Boundary Requirements: None. Program Exceptions: Addressing (no associated address space) Specification (invalid SRQ address, invalid Search.sub.-- Type) Dequeue Thread Dispatching Element (DQTDE)--This instruction dequeues the designated TDE. Upon dequeue, the TDE is no longer a valid TDE. ##STR10## Operation: No Search Priority is used. The TDE designated by the token in R1 is dequeued from the SRQ (Thread Send/Receive Queue) wait list, SRC (Thread Send/Receive Counter) wait list, or TDQ (Thread Dispatching Queue) designated by the token in R2. Upon dequeue, the TDE is no longer a valid TDE. No thread dispatching is involved in a DQTDE.
______________________________________
Condition Code:
______________________________________
0 One or TDEs remain after a successful dequeue.
1 No TDEs remain after a successful dequeue.
3 No TDE dequeued (invalid TDE address).
______________________________________
Boundary Requirements: None. Program Exceptions: Addressing (no associated address space) Specification (invalid SRQ, SRC or TDQ address) Destroy Thread Send/Receive Counter (DSSRC)--This instruction destroys or makes unavailable the Thread Send/Receive Counter (SRC) designated by the first operand. ##STR11## Operation: The Thread Send/receive Counter designated by the first operand is made unavailable. If the first operand does not specify a valid SRC a specification exception occurs. Subsequent attempts to reference a destroyed SRC will result in a specification exception. Condition Code: Unchanged. Boundary Requirements: None. Program Exceptions: Addressing (no associated address space) Specification (invalid SRC address) Destroy Thread Send/Receive Queue (DSSRQ)--This instruction destroys or makes unavailable the designated Thread Send/Receive Queue (SRQ). ##STR12## Operation: The Thread Send/Receive Queue designated by the first operand is made unavailable. If the first operand does not specify a valid SRQ a specification exception occurs. Subsequent attempts to reference a destroyed SRQ will result in a specification exception. Condition Code: Unchanged Boundary Requirement: None Program exceptions: Addressing (no associated address space) Specification (invalid-SRQ address) Destroy Thread Dispatching Queue (DSTDQ)--This instruction destroys or makes unavailable the designated Thread Dispatching Queue (TDQ). ##STR13## Operation: The Thread Dispatching Queue designated by the first operand is made unavailable. If the first operand does not specify a valid TDQ a specification exception occurs. Subsequent attempts to reference a destroyed TDQ will result in a specification exception. Condition Code: Unchanged. Boundary Requirements: None. Program Exceptions: Addressing (no associated address space) Specification (invalid TDQ address) Dispatch Thread Dispatching Queue (DTDQ)--This instruction locates the first operand designated by the TDQ (Thread Dispatching Queue), and the thread dispatcher is invoked. The current state is not saved in a TDE. Thus, this instruction defines the logical end of a thread. Like an unconditional branch, this instruction causes an unconditional transfer of control, and the next sequential instruction (NSI) is never executed. ##STR14## Operation: The TDQ (Thread Dispatching Queue) designated by the first operand is located and the thread dispatcher is invoked. The current state is not saved in a TDE, thus this instruction defines the logical end of a thread. Like an unconditional branch, this instruction causes an unconditional transfer of control and the next sequential instruction is never executed. Condition Code: Unchanged. Boundary Requirements: None. Program Exceptions: Addressing (no associated address space) TDQ Empty Specification (invalid TDQ) Enqueue Message (EQM)--This instruction causes the message list of the SRQ (Thread Send/Receive Queue) to be searched, in sequence beginning with the first message. The Thread Send/Receive Message is enqueued to the message list of the designated Thread Send/Receive Queue with a designated priority. ##STR15## Operation: The message list of the SRQ designated by R2 is searched, in sequence, beginning with the first message. The message, contained in the register designated by R1, is enqueued First/Last, as designated by the value of I3 (00x=First, 01x=Last), within priority order. The priority of the message is specified by bits 24-31 of R4. The type of the register (GPR, FPR, etc.) designated by R1 is determined from the Message Type field of the SRQ. If there are no messages of the same priority, the new message is enqueued before the first message with a larger priority value, or last if there is none. The priority is treated as an unsigned binary value. Condition Code: Unchanged Boundary Requirements: None Program Exceptions: Addressing (no associated address space, no message space available) Specification (invalid Enqueue type or SRQ address) Enqueue Thread Dispatching Element (EQTDE)--This instruction defines a TDE (Thread Dispatching Element), and the TDE is enqueued to the specified TDQ (Thread Dispatching Queue) wait list. ##STR16## Operation: A TDE (Thread Dispatching Element) defined by the TDE specification is enqueued to the specified TDQ (Thread Dispatching Queue) wait list designated by R3. Enqueuing is in priority sequence; low priority first, last within priority value. If the TDE is a fixed TDE, the address of the enqueued TDE is returned in the register specified by R1. The TDE.sub.-- specification, in the storage location designated by D2(B2), is used to control the content of the TDE:
__________________________________________________________________________
BYTEs
BITs
Description
__________________________________________________________________________
0-1 Descriptor
0-3 Version (only `0001`B allowed)
4 Ignored
5-6 Reserved = 00
7 Fixed/Removable TDE
= 1 Fixed. This TDE is not removed from the event/normal queue
when the specified event (below) occurs or the TDE is
dispatched.
= 0 Removable. This TDE is removed from the event/normal queue
when the specified event (below) occurs or the TDE is
dispatched.
8-11
Event Control: The event control bits are used by the EQTDE
instruction when the TDE is being enqueued to a TDQ. All TDEs
enqueued to an SRC or an SRQ must have event control specified
as
"normal" (= 0000) or else a specification exception occurs. They
control whether the TDE is placed on the normal queue or one of
the
"event" queues:
= 0000 Normal. The TDE is to be enqueued to the normal
(dispatchable) TDE queue. These TDEs are ready to be dispatched.
= 0001 Empty event. This TDE is to be made dispatchable when
there is an attempt to dispatch and empty TDQ (`Normal` TDE
queue
is empty).
= 0011 Resumption event. This TDE is to be made dispatchable
when the TDQ (`Normal` TDE queue) goes from empty to non-empty.
= 0110 More Work event. This TDE is to be made dispatchable
when a TDE is added to the TDQ (`Normal` TDE queue).
TDEs are enqueued to the event queues in priority order. There
may
be many "removable" event TDEs for a given event condition, or
one
"fixed" TDE, but not both. When the specified event occurs the
event
TDE is "triggered". If it is a fixed TDE, the TDE content is
copied
and the copied TDE is placed on the normal (dispatchable) queue.
If,
however, it is a removable TDE, the TDE is moved to the normal
(dispatchable) queue. Multiple TDEs may be placed on the
dispatchable queue as part of a single operation. For example, if
N
TDEs are placed on the dispatchable queue, up to N event TDEs
(fixed
or removable) may also get placed on the dispatchable queue.
(vote,
for fixed events, copies of the events are created and placed
upon the
dispatchable queue.) The placement of event TDEs on the
dispatchable
queue do not themselves cause other events to be triggered. This
is
true for both fixed and removable events. All event TDEs are
placed
on the dispatchable queue BEFORE any of the triggering TDEs if
they
are of the same priority. The Resumption and More Work events
are
overlapping conditions. If there are event TDEs for both, the
resumption event is triggered. If only a More Work event is
specified,
then that is triggered when the normal queue goes from empty to
non
empty. When and event TDE is placed on the normal queue, the
event
control is set to normal (`0000`B).
12-15
Reserved = 0000
2-6 State Flags Vector - The state (below) to be placed in the TDE.
(The
PSW is always saved).
0 = 1 GPRs
1 = 1 Access Registers
2 Reserved (0)
3 = 1 Floating Point Registers
4 = 1 Vector Registers and Status Register
5 = 1 Vector Mask Register
6-39
Reserved
7 TDE Priority: -8-bit unsigned. The priority assigned to a TDE
when
enqueued to a TDQ (the priority is ignored when a TDE is
enqueued
to an SRC or an SRQ - the priority is taken from the SRC or
SRQ.)
The highest priority is zero. TDEs are enqueued in priority
sequence,
last within the sane priority, when moved to the TDQ (all TDEs on
an
SRQ or SRC are of the same priority).
8-23 Reserved
24-31 Reserved
32-xx Save Area: (For items specified in the State Flags Vector - when
presented on input (e.g., EQTDE) or output (e.g., MTTDE) the
items
specified in the State Flags Vector are in ADJACENT storage
locations (no holes for unselected items). Thus, the offset to
any
specific set of items depends upon the prior items specified in
the State
Flags Vector):
.cndot. 32-35 Instruction Address
.cndot. GPR Contents - Regs 0 through 15.
.cndot. Access Register Contents - Regs 0 through 15.
.cndot. Floating Point Register Contents - Regs 0 through
__________________________________________________________________________
4.
No thread dispatching occurs. Condition Code: Unchanged Boundary Requirements: None Program Exceptions: Addressing (No associated address space, no TDE space available.) Specification (1st and 3rd operands: invalid TDE, TDQ, SRQ or SRC address; second operand: Fixed event specified and events are already defined, Removable event specified and a fixed event is already defined, invalid Version, invalid State Flags Vector, invalid Event Control value) Materialize Thread Send/Receive Counter (MTSRC)--This instruction presents the characteristics and contents of the Thread Send/Receive Counter (SRC) in addressable storage. ##STR17## Operation: The contents and characteristics of the Thread Send/Receive Counter designated by R1 are displayed in the storage location designated by R2 and L3 (starting at the address specified in R2 up to the length specified by L3). L3 is treated as an unsigned binary value. If the number of bytes specified by L3 is inadequate, the operation Simply terminates after L3 bytes have been materialized, and the condition code is set accordingly. The format of the displayed Information is:
__________________________________________________________________________
BYTEs
BITs
Description
__________________________________________________________________________
0-1 Descriptor
0-3 Version
4 = 0 The SRC has no waiting TDEs.
= 1 The SRC has one or more waiting TDEs.
5 unused
6 = 0 The SRC has no "owner" (is not locked).
= 1 The SRC has an "owner".
7 Dispatch Control Option:
= 0 All TDEs are moved to the associated TDQ when the waiting
TDEs are to be dispatched.
= 1 Only the first TDE is moved to the associated TDQ when the
waiting TDEs are to be dispatched.
8 Short Wait Option: Certain high-level synchronizing constructs
such as
barriers, DOACROSS, etc. may cause threads to wait for very
short
periods. This bit allows the machine to know when such situations
may
occur and to possibly optimize their operation.
= 0 Normal mode - TDEs in wait on this SRC may be in wait for a
long period.
= 1 TDEs in wait on this SRC are expected to be in wait for only
a
very short period before the wait will be satisfied.
9-15
Reserved (0)
2-6 State Flags Vector - State to be saved. (The PSW is always
saved.)
0 = 1 Save the GPRs
1 = 1 Save the Access Registers
2 Reserved (0)
3 = 1 Save the Floating Point Registers
4 = 1 Save the Vector Registers and Status Register
5 = 1 Save the Vector Mask Register
6-15
Reserved (0)
16-31
= 1 Save CRO-CR16 (defined CRs only)
32-39
Reserved (0)
7 DE Priority: -8-bit unsigned. The priority assigned to a TDE
when
enqueued to a TDQ (the priority is ignored when a TDE is
enqueued
to an SRC or an SRQ - the priority is taken from the SRC or
SRQ.)
The highest priority is zero. TDEs are enqueued in priority
sequence,
last within the same priority, when moved to the TDQ (all TDEs on
an
SRQ or SRC are of the same priority).
8-15 Associated TDQ - The address of the TDQ where waiting TDEs are
to
be enqueued when they are to be moved to the TDQ.
16-19 Limit Value - 32-bit integer.
20-23 Count Value - 32-bit integer.
24-27 First waiting TDE Pointer (If no TDEs are waiting, descriptor bit
4 =
0.)
28-31 Owner: (Bit 6 = 0 if not owned - unlocked.) When an SRC is
"locked" by a RECC instruction, it may place a value in this
field.
When it is "unlocked" by a SENDC instruction, bit 6 of the
descriptor
is set to 0 indicating that it is unlocked. This may be used for
debugging deadlock situations.
__________________________________________________________________________
Boundary Requirements: None. Program Exceptions: Addressing (no associated address space) Materialize Thread Send/Receive Queue (MTSRQ)--This instruction presents the characteristics and contents of the Thread Send/Receive Queue (SRQ) in addressable storage. ##STR18## Operation: The contents and characteristics of the Thread Send/Receive Queue designated by R1 are displayed in the storage location designated by R2 and L3 (starting at the address specified in R2 up to the length specified by L3). L3 is treated as an unsigned binary value. If the number of bytes specified by L3 is inadequate, the operation simply terminates after L3 bytes have been materialized, and the condition code is set accordingly. The format of the displayed Information is:
__________________________________________________________________________
BYTEs
BITs
Description
__________________________________________________________________________
0-1 Descriptor
0-3 Version Number
4 = 0 The SRQ has no waiting TDEs.
= 1 The SRQ has one or more waiting TDEs.
5 = 0 The SRQ has no SRMs (Thread Send/Receive Messages)
= 1 The SRQ has one or more SRMs
6 Reserved (0)
7 Dispatch Control Option:
= 0 All TDEs are moved to the associated TDQ when the waiting
TDEs are to be dispatched.
= 1 Only the first TDE is moved to the associated TDQ when the
waiting TDEs are to be dispatched.
8-15
Message Type: Specifies the type of register(s) from/to which
the
message information is taken/placed (only the following values
are
valid):
= 00x No message information (only priority).
= 01x From/to a GPR.
= 02x From/to an even/odd GPR pair.
= 04x From/to an AR/GPR pair.
= 08x From/to an FPR.
2- 6 State Flags Vector - State to be saved. (The PSW is always
saved.)
0 = 1 Save the GPRs
1 = 1 Save the Access Registers
2 Reserved (0)
3 = 1 Save the Floating Point Registers
4 = 1 Save the Vector Registers and Status Register
5 = 1 Save the Vector Mask Register
6-15
Reserved (0)
16-31
= 1 Save CR0-CR16 (defined CRs only)
32-39
Reserved (0)
7 TDE Priority: -8-bit unsigned. The priority assigned to a TDE
when
enqueued to a TDQ (the priority is ignored when a TDE is
enqueued
to an SRC or an SRQ - the priority is taken from the SRC or
SRQ.)
The highest priority is zero. TDEs are enqueued in priority
sequence,
last within the same priority, when moved to the TDQ (all TDEs on
an
SRQ or SRC are of the same priority).
8-15 Associated TDQ: The address of the TDQ where waiting TDEs are to
be enqueued when they are to be moved to the TDQ.
16-19 First waiting TDE Pointer.- (If no TDEs are waiting, descriptor
hit 4 =
0.)
20-23 Message Count: - Fixed binary.
24-27 Message Length: - Fixed binary. The length of each of the
following
messages.
__________________________________________________________________________
The messages are displayed in priority order. For each SRM on the SRQ:
______________________________________
BYTEs BITs Description
______________________________________
0-6 Unused
7 Priority - 8-bit unsigned.
8-xx Message: Generally a pointer to a
message in addressable storage.
______________________________________
Boundary Requirements: None. Program Exceptions Addressing (no associated address space) Materialize Thread Dispatching Element (MTTDE)--This instruction presents the characteristics and contents of the Thread Dispatching Element (TDE) in addressable storage. ##STR19## Operation: The contents and characteristics of the Thread Dispatching Element designated by R1 are displayed in the storage location designated by R2 and L3 (starting at the address specified in R2 up to the length specified by L3). L3 is treated as an unsigned binary value. If the number of bytes specified by L3 is inadequate, the operation simply terminates after L3 bytes have been materialized, and the condition code is set accordingly. The format of the displayed information is:
__________________________________________________________________________
BYTEs
BITs
Description
__________________________________________________________________________
0-1 Descriptor
0-3 Version
4 = 0 This is the last TDE on the chain
= 1 This is NOT the last TDE on the chain
5-6 Reserved = 00
7 Fixed/Removable TDE
= 1 Fixed. This TDE is not removed from the event/normal queue
when the specified event (below) occurs or the TDE is
dispatched.
= 0 Removable. This TDE is removed from the event/normal queue
when the specified event (below) occurs or the TDE is
dispatched.
8-11
Event Control: The event control bits are used by the EQTDE
instruction when the TDE is being enqueued to a TDQ. All TDEs
enqueued to an SRC or an SRQ must have event control specified
as
"normal" (= 0000) or else a specification exception occurs. They
control whether the TDE is placed on the normal queue or one of
the
seventy queues:
= 0000 Normal. The TDE is to be enqueued to the normal
(dispatchable) TDE queue. These TDEs are ready to be dispatched.
= 0001 Empty event. This TDE is to be made dispatchable when
there is an attempt to dispatch and empty TDQ (`Normal` TDE
queue
is empty).
= 0011 Resumption event. This TDE is to be made dispatchable
when the TDQ (`Normal` TDE queue) goes from empty to non-empty.
= 0110 More Work event. This TDE is to be made dispatchable when
a TDE is added to the TDQ (`Normal` TDE queue).
TDEs are enqueued to the event queues in priority order. There
may
be many "removable" event TDEs for a given event condition, or
one
"fixed" TDE, but not both. When the specified event occurs the
event
TDE is "triggered". If it is a fixed TDE, the TDE content is
copied
and the copied TDE is placed on the normal (dispatchable) queue.
If,
however, it is a removable TDE, the TDE is moved to the normal
(dispatchable) queue. Multiple TDEs may be placed on the
dispatchable queue as part of a single operation. For example, if
N
TDEs are placed on the dispatchable queue, up to N event TDEs
(fixed
or removable) may also get placed on the dispatchable queue.
(Note,
for fixed events, copies of the events are created and placed
upon the
dispatchable queue.) The placement of event TDEs on the
dispatchable
queue do not themselves cause other events to be triggered. This
is
true for both fixed and removable events. All event TDEs are
placed
on the dispatchable queue BEFORE any of the triggering TDEs if
they
are of the same priority. The Resumption and More Work events
are
overlapping conditions. If there are event TDEs for both, the
resumption event is triggered. If only a More Work event is
specified,
then that is triggered when the normal queue goes from empty to
non-
empty. When and event TDE is placed on the normal queue, the
event
control is set to normal (`0000`B).
12-15
Reserved = 0000
2-6 State Flags Vector - The saved state: (The PSW is always saved).
0 = 1 GPRs
1 = 1 Access Registers
2 Reserved (0)
3 = 1 Floating Point Registers
4 = 1 Vector Registers and Status Register
5 = 1 Vector Mask Register
6-15
Reserved (0)
16-31
= 1 CR0-CR16 (defined CRs only)
32-39
Reserved (0)
7 TDE Priority: -8-bit unsigned. The Priority assigned to a TDE
when
enqueued to a TDQ (the priority is ignored when a TDE is
enqueued
to an SRC or an SRQ - the priority is taken from the SRC or
SRQ.)
The highest priority is zero. TDEs are enqueued in priority
sequence,
last within the same priority, when moved to the TDQ (all TDEs on
an
SRQ or SRC are of the same priority).
8-11 Next TDE pointer (if any): If this is the last TDE on the chain,
descriptor bit 4 = 0.
16-23 Current queue pointer: Address of the TDQ to which this TDE is
enqueued.
24-31 Reserved
32-xx Save Area: (For items specified in the State Flags Vector - when
presented on input (e.g., EQTDE) or output (e.g., MTTDE) the
items
specified in the State Flags Vector are in ADJACENT storage
locations (no holes for unselected items). Thus, the offset to
any
specific set of items depends upon the prior items specified in
the State
Flags Vector):
.cndot. 32-35 Instruction Address
GPR Contents - Regs 0 through 15.
Access Register Contents - Regs 0 through 15.
Floating Point Register Contents - Regs 0 through 4.
Vector and Status registers
Vector Mask Register
Control Registers
__________________________________________________________________________
Boundary Requirements: None. Program Exceptions: Addressing (no associated address space) Materialize Thread Dispatching Queue (MTTDQ)--This instruction presents the characteristics and contents of the Thread Dispatching Queue (TDQ) in addressable storage. ##STR20## Operation: The contents and characteristics of the Thread Dispatching Queue designated by R1 are displayed in the storage location designated by R2 and L3 (starting at the address specified in R2 up to the length specified by L3). L3 is treated as an unsigned binary value. If the number of bytes specified by L3 is inadequate, the operation Simply terminates after L3 bytes have been materialized, and the condition code is set accordingly. The format of the displayed information is:
__________________________________________________________________________
BYTEs
BITs
Description
__________________________________________________________________________
0-1 Descriptor
0-3 Version
4 = 0 The Normal dispatching queue is empty (no TDEs)
= 1 The Normal dispatching queue has one or more TDEs enqueued
5 = 0 The Empty Event queue is empty (no TDEs)
= 1 The Empty Event queue has one or more TDEs enqueued
6 = 0 The Resumption Event queue is empty (no TDEs)
= 1 The Resumption Event queue has one or more TDEs enqueued
7 = 0 The More Work Event queue is empty (no TDEs)
= 1 The More Work Event queue has one or more TDEs enqueued
8-15
unused
2-3 unused
4-7 Short Waiters Count: The number of SRCs which have their short
wait
descriptor bit set and which currently have one or more waiting
TDEs.
Initial value is 0. This is described under SRCs and the
SRC-related
instructions.
8-11 Normal TDE Queue: Pointer to the first dispatchable TDE (Bit 4 of
the
descriptor = 1 if a TDE is enqueued).
12-15 Empty Event 7DE Queue: Pointer to the first event TDE (Bit 5 of
the
descriptor = 1 if a TDE is enqueued).
16-19 Resumption Event TDE Queue: Pointer to the first event TDE (Bit 6
of
the descriptor = 1 if a TDE is enqueued).
20-23 More Work Event TDE Queue: Pointer to the first event TDE (Bit 7
of
the descriptor = 1 if a TDE is enqueued).
24-31 Parent TDQ address (optional): The TDQ which is to be dispatched
if
this TDQ runs out of work.
__________________________________________________________________________
Boundary Requirements: None. Program Exceptions Addressing (no associated address space) Purge (PURGE)--This instruction destroys all the objects associated with the designated address space. ##STR21## Operation: Depending upon the addressing mode, the associated address space specified by R1 is determined and all the objects associated with that address space are destroyed. If register 0 is specified by R1 then all objects associated with ALL address spaces are purged. This instruction is privileged. Condition Code: Unchanged. Boundary Requirements: None. Program Exceptions: Privileged Operation Receive Count (RECC)--This instruction causes the current value of the counter to be compared to a set limit. ##STR22## Operation: If the register designated by R1 is zero, then limit value in the counter is used as the limit. Otherwise the limit value in the designated register is used as the limit. The counter value in the SRC, designated by R2, is then compared to the limit value. If the value of the counter is greater than or equal to the limit value: If the limit value in the counter is being used, the counter value is decremented by the limit value. If the register indicated by R4 is not zero, the content of the register specified by R4 is saved as the "owner" of the SRC. (A value of 0 is used to indicate no owner.) The instruction completes. If the value of the counter is less than the limit value: The current state is saved in a TDE and is enqueued onto the SRC wait queue. If the SRC has the Short Wait Option set and no TDEs were previously waiting, the SRC is placed in the short wait state (Engineering Note: the Short Waiters Count in the associated TDQ is incremented). If the limit value in the counter is being used, the instruction completes, otherwise the instruction is nullified (so that the instruction is re-executed to check the limit value specified in the instruction). The thread dispatcher is invoked. Condition Code: Unchanged. Boundary Requirements: None. Program Exceptions Addressing (no associated address space, no TDE space available) Specification (invalid SRC address, invalid associated TDQ (Note: It is not required that the implementation check during the execution of the instruction for the existence of a valid associated TDQ, but if it attempts to use the associated TDQ and finds there is none this exception can be generated.)) TDQ Empty Receive Message (RECM)--This instruction causes a Thread Send/Receive Message to be received from a specified Thread Send/Receive Queue. ##STR23## Operation: The SRMs on the SRQ designated by R2 are searched sequentially, starting with the first SRM. The search is controlled by the Priority designated by bits 24-31 of R4. The first SRM satisfying the Search.sub.-- type, designated by I3, is dequeued. The message is placed in the register designated by R1 and the actual priority of the message is placed in bits 24-31 of R4. The type of register (GPR, FPR, etc.) designated by R1 is determined from the Message Type of the SRQ. The meaning of the Search Type is:
______________________________________
BITs Description
______________________________________
0 Message Priority = Search.sub.-- Priority
1 Message Priority < Search Priority
2 Message Priority > Search.sub.-- Priority
______________________________________
The Search.sub.-- Type is the logical inclusive OR of the designated bits. For a Search Type of binary 000x, no priority will satisfy the search type, therefore, this combination is invalid. A specification exception occurs. For a Search Type of binary 111x, the first message is dequeued. If no message satisfies the Search.sub.-- type, or if the message list is empty, R1 and R4 are not altered and the instruction is nullified. The current state is saved in a TDE and enqueued to the SRQ wait list and the thread dispatcher is invoked. Condition Code: Unchanged. Boundary Requirements: None. Program Exceptions: Addressing (no associated address space, no TDE space available) Specification (invalid SRQ address, invalid Search Type) TDQ Empty Send Count (SENDC)--This instruction causes the current value of the count field of the SRC (Thread Send/Receive Counter) to be incremented. ##STR24## Operation: If R4 does not indicate register zero, the content of the register designated by R4 is compared to the "owner" value of the SRC. If the SRC is not "owned", or if it is "owned" but the values are not the same, a specification exception is signaled and the execution of the instruction is halted. This is useful for debugging locking violations when the SRC is used as a lock. The current value of the count field in the SRC (Thread Send/Receive Counter) designated by R2 is incremented by the value contained in R1. If the new count value is greater than or equal to the limit value in the counter: The value of the counter is decremented by the value of the limit. The new value is returned in the register designated by R3. If the wait list is not empty, then, depending upon the value of byte 0 bit 7 of the SRC: ALL All the TDEs are dequeued form the wait list and enqueued in priority sequence on the associated TDQ. ONE The first TDE is dequeued from the wait list and enqueued in priority sequence on the associated TDQ. If the SRC has the Short Wait Option set, and TDEs were in wait on the SRC, and no TDEs remain in wait on the SRC, then the SRC is no longer in short wait (Engineering Note: the Short Waiters Count in the associated TDQ is decremented). When one or more TDEs from an SRQ or SRC are enqueued to a TDQ and the TDQ contains TDEs at a higher priority, the current state is saved in a TDE (at the same priority as the TDEs from the SRQ or SRC) and enqueued in priority order to the TDQ. The thread dispatcher is then invoked causing a thread switch to occur. This thread switch is referred to as a preempt wait to the thread issuing the send operation. If the new count value is less than the limit value in the counter: The new value is returned in the register designated by R3. If the counter would overflow, the value is not incremented and the instruction is nullified. A fixed point overflow exception is signaled. When a SENDC is issued, the SRC is removed from the "locked" state (this supports debugging of SRCs used as locks). This means that the "owner" value of SRC is set to zero indicating that it is "unlocked" by any TDE. Condition Code: Unchanged. Boundary Requirements: None. Program Exceptions Addressing (no associated address space, no TDE space available) Specification (invalid SRC address, invalid associated TDQ, unequal "owner" values) Fixed Point Overflow (SRC counter overflow) Send Count and Wait (SENDCW)--This instruction causes the value of the SRC (Thread Send/Receive Counter) to be incremented by an amount contained in a register designated in the operand. The state of the thread issuing the instruction is saved in a TDE and enqueued onto the SRC wait queue. ##STR25## Operation: The value of the SRC designated by R2 is incremented by the value contained in the register designated by R1. The state of the thread issuing the instruction is saved in a TDE and enqueued onto the SRC wait queue. If the new count value is greater than or equal to the limit value in the counter, the value of the counter is decremented by the value of the limit. Then, depending upon the Dispatch Control Option of the SRC: ALL All the TDEs are dequeued from the wait list and enqueued in priority sequence on the associated TDQ. ONE The first TDE is dequeued from the wait list and enqueued in priority sequence on the associated TDQ. If the SRC has the Short Wait Option set, and TDEs were in wait on the SRC, and no TDEs remain in wait on the SRC, then the SRC is no longer in short wait (Engineering Note: the Short Waiters Count in the associated TDQ is decremented). The thread dispatcher is then invoked. The "owned" state and value are unaffected. Condition Code: Unchanged. Boundary Requirements: None. Program Exceptions: Addressing (no associated address space, no TDE space available) Specification (invalid--SRC address, no associated TDQ defined) TDQ Empty Fixed Point Overflow (SRC counter overflow) Send Message (SENDM)--This instruction causes the message list of the designated SRQ (Thread Send/Receive Queue) to be searched, in sequence beginning with the first message, and the message is enqueued within priority order. ##STR26## Operation: The message list of the SRQ designated by R2 is searched, in sequence, beginning with the first message. The message, contained in the register designated by R1, is enqueued First/last, as designated by the value of I3 (00x=First, 01x=Last), within priority order. The priority of the message is specified by bits 24-31 of R4. The type of the register (GPR, FPR, etc.) designated by R1 is determined from the Message Type field of the SRQ. If there are no messages of the same priority, the new message is enqueued before the first message with a larger priority value, or last if there is none. The priority is treated as an unsigned binary value. The Dispatch Control Option of the SRQ determines the TDEs (Thread Dispatching Elements) that are dequeued from the SRQ wait list and enqueued in priority sequence to the TDQ ( | ||||||
