Graeme Wilson a écrit : >>I plan to use a simple mutex to avoid the linked list to be >>read/written >>at the same time. The application won't be under a heavy load so this >>isn't a critical point imo. >> >>Olivier B. >> > > > Oliver, > Where do you plan on locking/unlocking the mutex in the subagent code? > The obvious place to lock it is in get_first_data_point, but there > doesn't seem to be such an obvious place to unlock it. > > I ask because I am writing some similar code and have been looking into > this same issue. > > Cheers > Graeme. > >
At the begining, i planned to directly read through the original datas. But finally i choosed another method. once the get_first_data_point is called, i'm locking the structure with a mutex, then duplicate all the elements in the list, and use the copy insteed of the original one. Once it's done, i release the mutex, which allow other thread to update it again. Hope it will help Regards, Olivier B. ----- Olivier Beytrison Student in Telecommunication University of Applied science Fribourg - Switzerland ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders