[AGENT++] Synchronized access to newly NotificationOriginator derived class's instances from different threads

Frank Fock fock at agentpp.com
Tue Apr 20 23:17:16 CEST 2010


Hi Yasemin,

Subclassing the NotifricationOriginator is not necessary
and the Mib::notify method is thread safe, if the
underlying NotificationSender::notify method is.
Which is the case, for NotifricationOriginator.

Best regards,
Frank

On 20.04.2010 11:03, Yasemin YILMAZ wrote:
> Hi Frank and Agent++ users,
>
> Does Agent++ provide synchorized access to Mib::instance->notify(..)
> function from different threads simultaneously?
>
> I have a NotifricationOriginator derived class as following:
>
> class agentCpuUsageExceededTrap: public NotificationOriginator {
> public:
>      agentCpuUsageExceededTrap();
>      virtual ~agentCpuUsageExceededTrap();
>
>      virtual void  generate(Vbx*, int, const NS_SNMP OctetStr&);
> };
>
> And let's suppose, two agentCpuUsageExceededTrap instances will be used in
> different threads and both threads call the function generate concurrently
> (generate calls Mib::instance->notify(..)). In that case, does
> synchronization problem occur because Mib::instance is unique (singleton)?
> In this respect, is Agent++ thread-safe?
>
> Thanks so much for Agent++ and your helps
>
> Best regards,
> Yasemin
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the AGENTPP mailing list