You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Gary Gregory <ga...@gmail.com> on 2016/09/06 01:13:04 UTC

Thread management clean ups

Hi All,

I am continuing some thread management clean ups.

We use a couple of thread pools here and there and I plan on getting these
to shutdown consistently and predictably through the API I added a while
back: Configurator.shutdown(LoggerContext, long, TimeUnit). The idea is
that when you ask Log4j to shutdown, you can call this API and expect all
threads to stop terminate, no leaks.

To do this right, I am going to implement AbstractLifeCycle stop() to call
stop(long, TimeUnit) with default values. This means that most classes that
implement stop() will now implement stop(long, TimeUnit) instead and can
choose to ignore these args in simple cases.

Gary

-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Thread management clean ups

Posted by Gary Gregory <ga...@gmail.com>.
YW ;-)

Gary

On Tue, Sep 6, 2016 at 2:48 AM, Remko Popma <re...@gmail.com> wrote:

> Thank you! It is good to know the background of why some of these changes
> are happening.
>
> Sent from my iPhone
>
> On 2016/09/06, at 10:13, Gary Gregory <ga...@gmail.com> wrote:
>
> Hi All,
>
> I am continuing some thread management clean ups.
>
> We use a couple of thread pools here and there and I plan on getting these
> to shutdown consistently and predictably through the API I added a while
> back: Configurator.shutdown(LoggerContext, long, TimeUnit). The idea is
> that when you ask Log4j to shutdown, you can call this API and expect all
> threads to stop terminate, no leaks.
>
> To do this right, I am going to implement AbstractLifeCycle stop() to call
> stop(long, TimeUnit) with default values. This means that most classes that
> implement stop() will now implement stop(long, TimeUnit) instead and can
> choose to ignore these args in simple cases.
>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Thread management clean ups

Posted by Remko Popma <re...@gmail.com>.
Thank you! It is good to know the background of why some of these changes are happening. 

Sent from my iPhone

> On 2016/09/06, at 10:13, Gary Gregory <ga...@gmail.com> wrote:
> 
> Hi All,
> 
> I am continuing some thread management clean ups.
> 
> We use a couple of thread pools here and there and I plan on getting these to shutdown consistently and predictably through the API I added a while back: Configurator.shutdown(LoggerContext, long, TimeUnit). The idea is that when you ask Log4j to shutdown, you can call this API and expect all threads to stop terminate, no leaks.
> 
> To do this right, I am going to implement AbstractLifeCycle stop() to call stop(long, TimeUnit) with default values. This means that most classes that implement stop() will now implement stop(long, TimeUnit) instead and can choose to ignore these args in simple cases.
> 
> Gary
> 
> -- 
> E-Mail: garydgregory@gmail.com | ggregory@apache.org 
> Java Persistence with Hibernate, Second Edition
> JUnit in Action, Second Edition
> Spring Batch in Action
> Blog: http://garygregory.wordpress.com 
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory