CompuLab SBC-X270 Manual do Utilizador Página 73

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 226
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 72
SCIOPTA - Real-Time Kernel
User’s Manual Manual Version 4.1 8-1
SCIOPTA - Real-Time Kernel
8 SCIOPTA Trigger
8 SCIOPTA Trigger
8.1 Description
The trigger in SCIOPTA is a method which allows to synchronise processes even faster as it would be possible
with messages. With a trigger a process will be notified and woken-up by another process. Trigger are used only
for process coordination and synchronisation and cannot carry data. Triggers should only be used if the designer
has severe timing problems and are intended for these rare cases where message passing would be to slow.
Each process has one trigger available. A trigger is basically
a integer variable owned by the process. At process
creation the value of the trigger is initialized to one.
Figure 8-1: SCIOPTA Trigger
Trigger
sc_triggerWait()
sc_trigger()
Process waiting
on the trigger
Process issuing a
trigger event
8.2 Using SCIOPTA Trigger
There are four system calls available to work with triggers. The sc_triggerWait call decrements the value of the
trigger and the calling process will be blocked and swapped out if the value gets negative or equal zero. Only the
owner process of the trigger can wait for it. An interrupt process cannot wait on its trigger. The process waiting on
the trigger will become ready when another process triggers it by issuing a sc_trigger call which will make the
value of the trigger nonnegative.
The process which is waiting on a trigger can define a time-out value. If the time-out has elapsed it will be triggered
(becom
e nonnegative) by the operating system (actually: The previous state of the trigger is restored). If the now
ready process has a higher priority than the actual running process the operating system will preempt the running
process and execute the triggered process.
The s
c_triggerValueSet system calls allows to sets the value of a trigger. Only the owner of the trigger can set the
value. Processes can also read the values of trigger by the sc_triggerValueGet call.
Also interrupt processes have a trigger but they cannot wait on it
. If a process is triggering an interrupt process, the
interrupt process gets a software event. This is the same as if an interrupt occurs. The user can investigate a flag
which informs if the interrupt process was activated by a real interrupt or woken-up by such a trigger event.
Vista de página 72
1 2 ... 68 69 70 71 72 73 74 75 76 77 78 ... 225 226

Comentários a estes Manuais

Sem comentários