[AGENT++] AgentX++ issue on embedded PPC (BigEndian)

Claus Klein claus.klein at arcormail.de
Sun Apr 3 22:38:14 CEST 2011


Hi Frank,

you are right, this endianess test does not work with WIN32.

It was on a powerpc architecture with integrity OS. I will send you a  
better test.


By the way, is it really necessary to delete the responsePool while  
every init()?
I have to prevent this because we have limited threads available!


Best regards,

Claus

On 03.04.2011, at 22:20, Frank Fock wrote:

> Hi Claus,
>
> The fix regarding the word endianess seems
> to be not applicable in general.
>
> For operating system is that fix needed?
> What CPU architecture?
>
> There is only a ThreadPool with size one
> used, because otherwise a race condition
> could occur while processing the responses
> for the phases of a single SET request.
> I not sure if the problem still persists,
> but the size should only be changed with
> care and intensive testing.
>
> Best regards,
> Frank
>
>
> On 31.03.2011 22:01, Claus Klein wrote:
>> Hello,
>>
>> While working on an embedded PPC device with agentX++,
>>
>> I had to change the following code.
>>
>> I have 2 question about this responsePool, which is a ThreadPool with
>> size 1.
>>
>> Why is only a 1 Thread at this Pool used?
>> And why is the pool deleted every time after connection problems?
>>
>> SubAgentXMib::init()
>> {
>> 	init_response_pool();	// create new ThreadPool every time?
>>
>> 	// (re)initialize AgentX protocol
>> 	agentx->reinit();
>> 	// load persistent objects
>> 	Mib::init();
>> ...
>> }
>>
>> Claus
>>
>> === modified file 'agentX++/src/agentx_pdu.cpp'
>> --- old/agentX++/src/agentx_pdu.cpp	2010-10-31 08:30:19 +0000
>> +++ new/agentX++/src/agentx_pdu.cpp	2011-03-31 17:22:58 +0000
>> @@ -32,6 +32,12 @@
>>   namespace Agentpp {
>>   #endif
>>
>> +#if (BYTE_ORDER == LITTLE_ENDIAN)
>> +#undef WORDS_BIGENDIAN
>> +#else
>> +#define WORDS_BIGENDIAN
>> +#endif
>> +
>>   /**
>>    * AgentXOctets
>>    */
>>
>> === modified file 'agentX++/src/agentx_subagent.cpp'
>> --- old/agentX++/src/agentx_subagent.cpp	2010-11-05 12:06:56 +0000
>> +++ new/agentX++/src/agentx_subagent.cpp	2011-03-31 04:54:24 +0000
>> @@ -32,6 +32,10 @@
>>   namespace Agentpp {
>>   #endif
>>
>> +#ifdef _THREADS
>> +#undef _THREADS
>> +#warning "_THREADS disabled, responsePool not used!"
>> +#endif
>>
>>   class AgentXReconnect: public Runnable {
>>   public:
>> @@ -511,7 +515,7 @@
>>   {
>>   #ifdef _THREADS
>>   	if (responsePool) {
>> -		delete responsePool;
>> +		delete responsePool;	// FIXME prevent delete of this Pool while
>> connection problems
>>   	}
>>   	responsePool = new QueuedThreadPool(1);
>>   	responsePool->start();
>>
>> _______________________________________________
>> AGENTPP mailing list
>> AGENTPP at agentpp.org
>> http://lists.agentpp.org/mailman/listinfo/agentpp
>
> -- 
> AGENT++
> http://www.agentpp.com
> http://www.snmp4j.com
> http://www.mibexplorer.com
> http://www.mibdesigner.com
>
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp




More information about the AGENTPP mailing list