Thread safe SNMP++ ??

Thread safe SNMP++ ??

Post by Bret Clin » Tue, 11 Jul 2000 04:00:00



Does anyone out there know if there is a thread safe version of
SNMP++?  I have been told that I need to use mutex locks around the
calls to the snmp++ lib, but that defeats the purpose of having a multi-
 threaded app if I cant make calls from each thread (without having to
lock everything) to the snmp++ library.

Thanks,

Bret

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Thread safe SNMP++ ??

Post by Frank Foc » Wed, 12 Jul 2000 04:00:00


Hi Bret,

if you create a SNMP++ session within each thread, you do not have
to lock anything. This may not be the best solution, if you have
many threads or many dynamically created threads, because each session
does take its own UDP port and binding a port takes a while.

Regards,
Frank


> Does anyone out there know if there is a thread safe version of
> SNMP++?  I have been told that I need to use mutex locks around the
> calls to the snmp++ lib, but that defeats the purpose of having a multi-
>  threaded app if I cant make calls from each thread (without having to
> lock everything) to the snmp++ library.

--
Frank Fock                 Marconi Communications Software Systems

Phone: +49 7191 13-4851    71522 Backnang,            
Fax:   +49 7191 13-2502    Germany

 
 
 

Thread safe SNMP++ ??

Post by Bret Clin » Thu, 13 Jul 2000 04:00:00


Thats what I thought, but it doesnt work that way.  In the
implimentation of the SNMP++ library, they use several global
queues...the problem was one thread would pull something out of the
global queue and start processing it, then another thread would get the
same item and while it was using it, the first thread would delete
it...this causeing a segmentation fault.  I "fixed" the problem by
adding the thread id to each item added to the queue and then do a
check to ensure that only the thread that added the item can remove
it.  This works for my particular application (this time).  I only ran
into this problem when trying to process a large number of SNMP gets at
the same time.

Thanks for your reply
Bret

Quote:> Hi Bret,

> if you create a SNMP++ session within each thread, you do not have
> to lock anything. This may not be the best solution, if you have
> many threads or many dynamically created threads, because each session
> does take its own UDP port and binding a port takes a while.

> Regards,
> Frank

Sent via Deja.com http://www.deja.com/
Before you buy.
 
 
 

Thread safe SNMP++ ??

Post by Les Smithso » Mon, 17 Jul 2000 04:00:00


You might also run into problems with SNMP++ use of the gethost*()
functions. On Solaris 2.6, these are not thread safe.

I know, because I've been bitten by this.

--

 
 
 

1. Announcemt: Thread-safe SNMP++

Hi,

SNMP++, which was originally developed at HP by
Peter Mellquist, uses static event queues which are
all but one not synchronized. As a consequence,
SNMP++ could not be used in a multi-threaded
environment with unsynchronized SNMP sessions.

SNMP++v3.0.1 adds thread-safety and SNMPv3
support to the original SNMP++v2.8. Besides
SNMP++v3.0.1 eliminates the need for WinSNMP
on Windows 32bit platforms.

SNMP++v3.0.1 can be downloaded from the AGENT++
web site:
http://www.agentpp.com

Regards,
Frank Fock

2. Unspecied Error using Find.....

3. Thread safe SNMP library

4. FS: Sun Sbus Dual-Attach FDDI

5. Thread Safe SNMP tools

6. Type library localization

7. is UCD-snmp multi thread safe

8. Mailing list for Tk users?

9. Is Microsoft SNMP Management API thread safe?

10. Does IJG library thread safe??

11. Intel Jpeg library thread-safe?

12. T2 Thread Safe iostream library