CMPI_ThreadContext data structure each CMPI_ThreadContext objects are bound to a thread and thread internal all shared by CMPI object.
Therefore CMPI_ThreadContext actually is a thread private data (ThreadSpecificData, TSD). Based on the pthread thread library provides support, CMPI_ThreadContext class contains a static variable of type pthread_key_t. Called by pthread_setspecific CMPI_ThreadContext address of itself and the key bindings. While other threads CMPI object, you can call to get the pthread_getspecific thread CMPI_ThreadContext address. Based on this kind of mechanism, different thread CMPI objects are individually. Pegasus uses specialized classes to encapsulate each CIM objects, such as CIMInstance, CIMDateTime etc, then these objects encapsulate as CMPI_Object again. The main Member CMPI_Object is a pointer to a pointer to the wrapped object hdl and a table with their corresponding functions. The other is used to construct a CMPI_Object two-way queue pointer prev and next. CMPI_ThreadContext maintains links to in the head and tail of a queue CMPI_Object two-way CIMfirst and CIMlast pointer. In the thread created all the CMPI objects are documented in the queue. In order to be able to automatically release all the messages in the queue, the object of CMPI CMPI_ThreadContext in destructor (see Listing 1), then call the queue object in the release method. CMPI_ThreadContext::~CMPI_ThreadContext(){for(CMPI_Object*nxt,*cur=CIMfirst;cur;cur=nxt){nxt=cur->next;(reinterpret_castLinxu Security , the latest breaking news and information on security, linux, open source, firewalls
Tuesday, November 30, 2010
CMPI's memory management and implementation of Open Pegasus
Labels:
[:]
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment