[SNMP4J] Synchronous or asynchronous?

PHIL BERGSTRESSER phil.bergstresser at adtran.com
Tue Mar 8 22:59:28 CET 2005


You could get a lot of viewpoints on that question. I'll offer a simple start.

You didn't describe your test program, so it is impossible to explain the ordering you observed. I would guess you sent requests to different agents so that the network transmission time and agent responsiveness were varied.

The synchronous I/O is simpler to code so it can be quicker to get something working. But it serializes I/O that might be able to operate on a network concurrently, preventing multiple agents from responding concurrently thus slowing your overall throughput. You could put requests in different threads, but that seems harder to me, and not scalable to a large system.

The asynchronous I/O is more complicated to code because you don't know what to expect next in a response. But it allows concurrent I/O to different agents which may be on different subnets, so your service requests can be executed concurrently by the different agents. You also get the advantage that you respond to the order received, which is unpredictable, and may make your system seem more responsive.

HTH

Phil
Phil Bergstresser
Design Engineer
SNMP Network Management
ADTRAN, Inc.

 -----Original Message-----
From: 	Rodolfo Josÿffffe9 Castellanos Jaimes [mailto:rodolfojcj at yahoo.com] 
Sent:	Tuesday, March 08, 2005 12:04 PM
To:	snmp4j at agentpp.org
Subject:	[SNMP4J] Synchronous or asynchronous?

Hi friends.

In the Snmp documentation
(src/org/snmp4j/package.html), there is a paragraph
that says:

"With SNMP4J, SNMP messages can be sent synchronously
(blocking) and asynchronously (non-blocking). The Snmp
class does not use an internal thread to process
responses on asynchronous and synchronous requests.
Nevertheless it uses the receiver threads of the
transport mappings to process responses."

I did two programs, one sends messages synchronously
and the other one sends it asynchronously. The
difference that I noticed was in the order in which
the responses are processed. Which could be the
advantages/disadvantages of working with each one of
them ??

Thank you very much by your time and your attention.

Rodolfo José Castellanos Jaimes.

_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com
_______________________________________________
SNMP4J mailing list
SNMP4J at agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j



More information about the SNMP4J mailing list