RequestList::receive in a multithreaded environment

Frank Fock Frank.Fock____t-online.de
Wed Feb 19 00:25:55 CET 2003


Dan,

The RequestList does not run any thread. The ThreadManager
is a clumsy name for a now historical implementation of
the Synchronized class.

If you do not want to use POSIX threads (UNIX) or Win32
threads (W2K,XP) then you will have to change the
Synchronized and the Thread class implementations to avoid
conflicts by using two different thread APIs.

Aside from that, RequestList may be run in a thread other
than the main thread.

What also could have caused the problem is the stack size
of your thread!

Hope this helps.

Best regards,
Frank


Dan Perl wrote:
> I have problems getting RequestList::receive to run in a different 
> thread than the main thread.  I am using ACE threads and I create a 
> worker thread that invokes the RequestList::receive method with a 
> limited, positive timeout.  The request is detected by the receive 
> method, but the contents of the request are invalid: 
> ((*pdu).vbs[0]).iv_vb_oid.smival.value.oid.ptr = 0.  I guess there is 
> some memory allocated for the task and that memory is lost somehow.
> 
>  
> 
> Anyway, the behavior may not be so relevant, but it?s pretty clear that 
> there is a conflict there in using RequestList in a multithreaded 
> environment.  I saw that RequestList is itself a subclass of 
> ThreadManager which is a subclass of Synchronized, so there is some 
> threads work in RequestList itself.  How should I use 
> RequestList::receive to make it work in a non-main thread?
> 
>  
> 
> Regards,
> 
>  
> 
> Dan Perl
> 
> Taral Networks
> 
> Ottawa, Canada
> 







More information about the AGENTPP mailing list