> Ok, lets see if I got this right. You have the main agent thread, and two
> worker threads. The worker threads don't do any SNMP other than to call
> send_v2trap. Is that right?

Yep you got it.

> GC> > Have you implemented any locking mechanism?
> GC>
> GC> Standard pthread mutexs were used.
>
> Can you elaborate on that? Where are they used? Who blocks who, and when?

The download to the hardware device or upload can take time and didnt want
another request to be handled
so I use:

pthread_mutex_lock(&operationMutex)
       Download data to hardware device
       Send trap
pthread_mutex_unlock(&operatonMutex)


Thanks,
Garyc

----- Original Message -----
From: "Robert Story (Users)" <[EMAIL PROTECTED]>
To: "Gary Clark" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, October 27, 2004 11:57 AM
Subject: Re: Sending traps in another thread


> On Wed, 27 Oct 2004 10:50:25 -0500 Gary wrote:
> GC> Wow! I'm blessed one of the gurus. Ok no problem.
>
> Really, where? (looking around for my autograph book)
>
> GC> Its within this oject that I created threads. I have only two threads
in
> GC> this global object. One to monitor link up and link downs and to
invoke a
> GC> trap when this happens. Another to send a trap upon the completion
> GC> of a download or upload to and from the hardware. I dont want to block
the
> GC> main thread so this was a good solution.
>
> Ok, lets see if I got this right. You have the main agent thread, and two
> worker threads. The worker threads don't do any SNMP other than to call
> send_v2trap. Is that right?
>
>
> GC> > Have you implemented any locking mechanism?
> GC>
> GC> Standard pthread mutexs were used.
>
> Can you elaborate on that? Where are they used? Who blocks who, and when?
>
>
> Thanks for taking the time to contribute to the shared knowledge..
>
> --
> Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
> <irc://irc.freenode.net/#net-snmp>
> Archive:
<http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users>
>
> You are lost in a twisty maze of little standards, all different.



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
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

Reply via email to