On Sun, 2002-12-08 at 21:07, Sunil Pandit wrote:
> James
> Its not CacheEventQueue but its in ElementEventQueue. Please check the
> QProcessor::Run method in class org.apache.jcs.engine.control.event
> .ElementEventQueue class. The current version 1.3 in the repository still
> got the code in the run method which calls Thread.Destroy on receiving the
> Interrupted exception.
> 
> public void run()
>         {
>             AbstractElementEventRunner r = null;
> 
>             while ( !destroyed )
>             {
>                 try
>                 {
>                     r = take();
> 
>                     if ( log.isDebugEnabled() )
>                     {
>                       log.debug( "r from take() = " + r );
>                     }
> 
>                 }
>                 catch ( InterruptedException e )
>                 {
>                     // We were interrupted, so terminate gracefully.
> 
>                     this.destroy();

Perhaps this should be "CacheEventQueue.this.destroy()"? 

OR is "destroyed = true" better?

>                 }
> 
>                 if ( !destroyed && r != null )
>                 {
>                     r.run();
>                 }
>             }
> 
>             log.info( "QProcessor exiting for " + ElementEventQueue.this );
>         }
>     }
> 
> 
>                                                                                      
>                              
>                     James Taylor                                                     
>                              
>                     <james               To:     Turbine JCS Users List 
><[EMAIL PROTECTED]>      
>                     @jamestaylor.        cc:                                         
>                              
>                     org>                 Subject:     Re: Is this defect ???         
>                              
>                                                                                      
>                              
>                     12/05/2002                                                       
>                              
>                     02:53 PM                                                         
>                              
>                     Please                                                           
>                              
>                     respond to                                                       
>                              
>                     "Turbine JCS                                                     
>                              
>                     Users List"                                                      
>                              
>                                                                                      
>                              
>                                                                                      
>                              
> 
> 
> 
> 
> That does not appear to be the case in the current CVS (1.4)
> 
> see:
> 
> 
>http://cvs.apache.org/viewcvs.cgi/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/CacheEventQueue.java.diff?r1=1.3&r2=1.4&diff_format=h
> 
> 
> On Thu, 2002-12-05 at 15:48, Sunil Pandit wrote:
> > James
> >
> > QProcessor::Run method calls this.destroy in the exception handler code
> > where it handles InterruptedException .
> >
> > Thanks
> > Sunil
> >
> >
> >
> 
> >                     James Taylor
> 
> >                     <james               To:     Turbine JCS Users List
> <[EMAIL PROTECTED]>
> >                     @jamestaylor.        cc:
> 
> >                     org>                 Subject:     Re: Is this defect
> ???
> >
> 
> >                     12/05/2002
> 
> >                     01:54 PM
> 
> >                     Please
> 
> >                     respond to
> 
> >                     "Turbine JCS
> 
> >                     Users List"
> 
> >
> 
> >
> 
> >
> >
> >
> >
> > On Thu, 2002-12-05 at 14:43, Sunil Pandit wrote:
> > > Hello JCS Users
> > >
> > > I came across an interesting defect in JCS .
> > > During an Initialization of JCS instance when it creates a
> CompositeCache
> > > instance, It creates an instance of ElementEventQueue.
> ElementEventQueue
> > > further creates a thread in form of an instance of QProcessor.
> > > This thread is never destroyed. If we test our application  under heavy
> > > load we found that several of these threads remain active. This thread
> is
> > > created per instance of CompositeCache and therefore should be
> destroyed
> > > when the composite cache is disposed.
> >
> > Yes, ElementEventQueue.Destroy should definitely be called in
> > CompositeCache.Dispose
> >
> > > Also there is one more defect in JCS in same context. To correct the
> > above
> > > defect I thought I can use  ElementEventQueue::Destroy method which
> calls
> > > interrupt on QProcessor. The run method for this thread calls
> > > Thread::Destroy method which is unimplemented in JDK 1.4 . So we just
> > > modified the run method to set the destroy flag to true on Interrupt
> > event
> > > so that the thread can gracefully exit.
> >
> > That sounds reasonable also, where exactly is Thread.destory called?
> > Just want to be sure I am following you.
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <
> > mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: <
> > mailto:[EMAIL PROTECTED]>
> >
> >
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <
> mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: <
> mailto:[EMAIL PROTECTED]>
> >
> 
> 
> --
> To unsubscribe, e-mail:   <
> mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <
> mailto:[EMAIL PROTECTED]>
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to