Let us look at a general case where some tasks A and B want to exchange messages. Tasks A and B agree that A sends data of type MyMsg to B via SCOM queues named "scomA" for task A, and "scomB" for task B. The following steps would occur:
SCOM 用到的函数:
• SCOM_init(). Initializes the module. • SCOM_exit(). Ends use of the module. • SCOM_create(). Creates a new SCOM queue object. • SCOM_open(). Gets a reference to an existing SCOM queue object by name. • SCOM_delete(). Deallocates and deletes an SCOM queue object. • SCOM_putMsg(). Places SCOM message in an SCOM queue. • SCOM_getMsg(). Receives SCOM message from an SCOM queue.
分析: SCOM_create()得到SCOM队列的句柄。 Syntax scomQueue = SCOM_create(queueName, *attrs); Parameters String queueName; /* Name of SCOM queue to create */ SCOM_Attrs *attrs; /* SCOM object attributes; only NULL supported */ Return Value SCOM_Handle /* handle of new SCOM queue */