8 - 12 8 - 12
MELSEC-Q
8 MULTITASK PROCESSING
Deadlock example
BASIC
program (A)
ZRESERVE 1
BASIC
program (B)
Resource with
resource number 1
Resource with
resource number 2
Request
In use
ZRESERVE 2
ZRESERVE 2
ZRESERVE 1
Program A requested to use
the resource with resource
number 2, but is put into the
wait status because program
B is using it.
Program B requested to use
the resource with resource
number 1, but is put into the
wait status because program
A is using it.
Both programs
were put into the
wait status and
keep each other
from continuing.
This situation is
called the deadlock
status.
Request
Request
Request
In use
In this case, if the "timeout" parameter is specified by each ZRESERVE instruction, a
timeout error occurs after the specified period of time and the execution interrupted
status can be released.
However, it is not preferable to release the execution interrupted status by generating
an error; it is recommended to modify the program appropriately.
(5) Types of resources which are managed by the OS program of the
communication module
Resources that do not require mutual exclusive control are as follows.
(a) Resources managed by the OS of the communication module
• Channel numbers for data communication with external devices.
• File numbers specified for input/output interaction with files and
devices.
• Priorities that define the program's execution order.
High priority numbers may be used in mutual exclusion, however.
For example, if an emergency processing at an error occurrence needs to
be executed preceding other programs.
• Character strings assigned to function keys
(b) Resources managed by each program
• Variables and Arrays handled by the program.
Resources other than the ones listed above can be accessed by all
programs.
For example:
Text screen
Keyboard
Files and disks
Extension devices of the communication module
Event numbers
Resource numbers etc.
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...