473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

PySNMP Thread unsafe?

I'm trying to monitor about 250 devices with SNMP, using PySNMP version
4. I use the threading.Thread to create a threadpool of 10 threads, so
devices not responding won't slow down the monitoring process too much.
Here comes my problem. When using PySNMP single threaded, every this
goes well; but if I create 10 threads, it all goes awry... It seems
PySNMP is not thread safe? Can anyone elaborate on this?

Jul 24 '06 #1
3 2816
On Mon, Jul 24, 2006 at 02:21:10AM -0700, ro************@gmail.com wrote:
I'm trying to monitor about 250 devices with SNMP, using PySNMP version
4. I use the threading.Thread to create a threadpool of 10 threads, so
devices not responding won't slow down the monitoring process too much.
Here comes my problem. When using PySNMP single threaded, every this
goes well; but if I create 10 threads, it all goes awry... It seems
PySNMP is not thread safe? Can anyone elaborate on this?
What does 'goes awry' mean? Your statement is too vague to be able to help
you figure out your problem.
>
--
http://mail.python.org/mailman/listinfo/python-list
Jul 24 '06 #2
pysnmp has been designed to be MT-safe. Although, I've never used it in
a MT app, so there may be a bug showing up when you do threading...

At its simplest, I'd advise snooping on the wire to make sure you are
querying different devices at the same time and also to see where the
[I assume] bottleneck really is -- is it in a sending or receiving
phase of the query.

If you could show me the code that causes the trouble?

ro************@gmail.com писал(а):
I'm trying to monitor about 250 devices with SNMP, using PySNMP version
4. I use the threading.Thread to create a threadpool of 10 threads, so
devices not responding won't slow down the monitoring process too much.
Here comes my problem. When using PySNMP single threaded, every this
goes well; but if I create 10 threads, it all goes awry... It seems
PySNMP is not thread safe? Can anyone elaborate on this?
Jul 25 '06 #3
ro************@gmail.com <ro************@gmail.comwrote:
I'm trying to monitor about 250 devices with SNMP, using PySNMP version
4. I use the threading.Thread to create a threadpool of 10 threads, so
devices not responding won't slow down the monitoring process too
much.
This is surely a job for twisted not threads? You'd be able to poll
all 250 devices at once with twisted...

This might be helpful (haven't tried it myself though)

http://twistedsnmp.sourceforge.net/

--
Nick Craig-Wood <ni**@craig-wood.com-- http://www.craig-wood.com/nick
Jul 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: WIWA | last post by:
I have recently installed pySNMP 3.3.2 and use Python 2.2.2. Thanks to Peter Hansen, I succeeded to install pySNMP properly. I'm not completely new to SNMP (I know the basics), but I'm new to...
0
by: WIWA | last post by:
Hi, I have installed pySNMP. I want to make an application where I read out all the OIDs of a MIB of a particular device. In other words, I want to do an SNMPwalk for a certain MIB. I can do...
2
by: Axel Scheepers | last post by:
Hi All, Python is so great. I've been creating a small set of objects to get some stats from our adsl routers. So far it works great and fast. However, in the shell script I created over a year...
4
by: Roy Smith | last post by:
There's been some talk recently about the relative speeds of the various python SNMP libraries. I just did a little benchmarking, and got some surprising results. I downloaded pysnmp-3.4.2 and...
5
by: Roman Suzi | last post by:
(this is a repost with an addition - probably noone noticed my message first time) Hi! Just to be sure, is email package of Python 2.3 thread-safe or not (to use, for example, in...
3
by: Philip V Pham | last post by:
These questions apply to std vector, map, and cout: I am uncertain of the thread safety for reading/writing for std templates. I know if all threads are reading concurrently, it is thread...
9
by: Alexander Fleck | last post by:
Hi, I' ve to make a software module thread safe. I know how to realize that and what' re the main topics of thread safety. But I don' t know how thread safety can be tested. I read about a test...
2
by: Tom Vandeplas | last post by:
Hi all, When using an asynchronous API call (in my case WriteFileEx) in a thread it seems to become blocking instead of non-blocking (see details below). Can somebody explain me what is...
18
by: Dave Booker | last post by:
I have a Thread making a callback to a Form function that alters Form data. Of course, the debugger is telling me, "Cross-thread operation not valid: Control 'FormTest' accessed from a thread other...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.