Chapter 14 Multitasking Control Statements
14-7
CREATESEM (Function)
Function
Creates a semaphore.
Format
CREATESEM (<Arithmetic expression>)
Explanation
This function creates a semaphore and obtains a semaphore ID.
If there is no semaphore ID, other semaphore related commands cannot be
used. Therefore, be sure to execute this CREATESEM command prior to
using a semaphore.
Designate a task queuing (execution waiting) system using an argument.
Determine the execution order if plural tasks have the same semaphore.
The following two types of queuing systems are available.
Argument
0 First-come sequence
Other than 0 Priority order of tasks
First-come sequence is the order in which TAKESEM commands are executed.
Task priority is designated with an option (PRIORITY) of the RUN command.
As soon as CREATESEM is executed, the system status changes to the one
where a semaphore is present. Therefore, TAKESEM can be executed even if
GIVESEM is not executed.
Up to 32 semaphores can be created.
Related Terms
DELETESEM, FLUSHSEM, GIVESEM, TAKESEM
Comments to this Manuals