Can a session created with Single Session API be used by multiple threads?

Xiangyang Shen <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hello,

Sorry about a mistake in my previous email. When I said "Single API" I 
meant Single Session API. Could someone please help me with following 
questions:
1. Can I use Single Session API to create/open a session in main thread 
then let the session been used by a thread pool in an application 
program (not a snmp agent)?
2. If a session can NOT be shared by MT even with Single Session APIs, 
can each thread of thread pool create multiple sessions (using different 
session to send requests to different agent)?
3. If 1&2 are both not thread safe, does that mean I can only use one 
session per thread with Single Session APIs?

Your help would be very appreciated.

Thanks,
Xiangyang

> Hello,
> 
> I'm writing an application program that uses thread pool to monitor 
> multiple snmp agents and provides data services to its clients.
> 
> I went through README.thread and NetSnmp User mail archive. I understand 
> it's not MT safe if I use V3. But in case of v1 & v2 it isn't clear to 
> me that if a session is opened with Single Session APIs in main thread for a 
> agent before the thread pool is created
> - can the session be used by multiple threads safely to send request to 
> the agent?
> - if a session can't be shared by MT, can each thread in the thread pool 
> open multiple sessions (for different agents) with Single Session APIs then use 
> them safely?
> - or Single Session APIs means each thread can only use one session created by 
> the thread?
> 
> The current project design is to open a session for each monitored 
> agent. A thread getting a data request from client will find the proper 
> session then uses the session to send snmp request to the target agent. 
> Since we don't have control about which thread will get the request from 
> a client for which agent data (requests are sent through CORBA calls) we 
> can't use dedicated thread to serve an agent (i.e. 
> per-thread-per-session module). Will the design have thread safe problem 
> even using Single Session APIs?
> 
> Thanks for your help in advance,
> Xianygang
> 
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Net-snmp-users mailing list
> [email protected]
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/listinfo/net-snmp-users


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.