lmz:
中断是传递给进程的。
每一个节点内的进程都可以给自己/他人预设中断,也可以删除中断。
比如:
op_intrpt_clear_self()
Cancels all self interrupts pending for the invoking process.
只能删除自己的中断。
op_intrpt_schedule_self()
In cases where a self interrupt is representing a time-out, or some similar event, it is sometimes useful to cancel the self interrupt if it becomes unnecessary (for example, when a time-out needs to be revoked due to an ack being received before the time-out elapses). Cancelling an interrupt requires that the event handle returned by this KP be stored in a state variable, to be later passed to the KP
op_ev_cancel()
, as in the following examples:
/* state variable declaration */
Evhandle \evh;
/* self interrupt scheduling */
evh = op_intrpt_schedule_self (sch_time, 5);
/* self interrupt cancelling */
op_ev_cancel (evh);
lmz:
这个函数预设的中断是给当前正在被唤醒的进程。
进程是在queue或者processor中,所以这个预设的中断是给了op_self_id()
.
op_intrpt_schedule_remote()
Syntax
op_intrpt_schedule_remote (time, code, mod_objid)
Argument | Type | Description |
---|---|---|
mod_objid | Objid | object ID of the processor or queue which will receive the interrupt |
for instance, a queue process can interrupt a processor in another node when it has saturated its packet capacity
lmz:
当前正在被唤醒的进程可以为其他节点内的processor或者queue预设中断。
op_intrpt_strm()
The two types of interrupts that are associated with streams are stream interrupts and access interrupts. In the former case, the stream associated with the interrupt will be an input stream on which a packet has arrived. In the latter case, the stream associated with the interrupt will be an output stream which is being accessed by the module to which it is connected.
lmz:
获取中断的流索引。
作判断之用。
op_intrpt_stat()
获取数据中断的索引。
op_intrpt_code()
Provides a mechanism to determine the user-defined numeric code associated with an interrupt, in order to identify its purpose. This is necessary when there are several different interrupts of the same type pending, associated with different purposes.
lmz:
中断码往往是和以下的核心函数有关
- op_intrpt_schedule_self()
- op_intrpt_schedule_remote()
- op_intrpt_force_remote()
tags:opnet