代码改变世界

Shared-memory object ---VxMP

2011-08-22 13:20  Jeff  阅读(8873)  评论(0编辑  收藏  举报
VxMP is a VxWorks component that provides shared-memory objects dedicated to high-speed synchronization and communication between tasks running in separate instances of VxWorks. ================================= 啥叫"separate instances of VxWorks." Shared-memory objects are a class of system objects that can be accessed by tasks running on different processors accessible by all processors. ===================================== P4080所有8个核都能访问这块内存? Shared-memory objects are an extension of local VxWorks objects. Local objects are only available to tasks on a single processor. ================================================================ local Vxworks object只能访问单个核上的数据 VxMP supplies the following types of shared-memory objects: ■ shared semaphores (binary and counting) ■ shared message queues ■ shared-memory partitions (system- and user-created partitions) ====================================================== semaphore, message queue, share-memory partitions Shared-memory objects provide the following advantages: ■ A transparent interface that allows shared-memory objects to be manipulated with the same routines that are used for manipulating local objects. ■ High-speed inter-processor communication—no going through an unnecessary network stack. ■ The shared memory can reside either in dual-ported RAM or on a separate memory board. ====================================================== 用操作localobject的routine操作share-memory的object processor之间快速交互 最后一个是啥... VxMP consists of the following facilities: a name database (smNameLib), task synchronization and resource tracking with semaphores (semSmLib), messaging with message queues (msgQSmLib) to build a custom protocol, a shared-memory allocator (smMemLib). ======================================================= VxMP只能用在kernel space,不能用于SMP VxMP提供创建shared memory object的API,返回object ID.这个object ID用于identify这个 object,而且是global to the VxMP system, regardless of the CPU from which it is accessed. After a shared-memory object is created, kernel tasks can operate on it with the same routines used for the corresponding local object. Such as: semGive( ), semTake( ), msgQSend( ), msgQReceive( ), memPartAlloc( ), and memPartFree( ) to operate on both types of objects. Kernel tasks on any CPU can create and use shared-memory objects. No processor has priority over another from a shared-memory object’s point of view ================================================================== 对shared memory object来说,所有CPU都是平等的. Shared-memory object cannot used at interrupt level. Note that shared-memory objects are allocated from dedicated shared-memory pools, and cannot be deleted. ======================================================= ISR不能调用使用shared-memory object的routione. Shared-memory object 不能删除.