You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2011/10/10 20:22:30 UTC
[jira] [Issue Comment Edited] (WW-3691) BackgroundProcess should
use a java.util.concurrent.Executor alternatively to spawning a new thread
[ https://issues.apache.org/jira/browse/WW-3691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13124358#comment-13124358 ]
Lukasz Lenart edited comment on WW-3691 at 10/10/11 6:21 PM:
-------------------------------------------------------------
Is it a sufficient solution ? See attached patch
was (Author: lukaszlenart):
Is it a sufficient solution ?
> BackgroundProcess should use a java.util.concurrent.Executor alternatively to spawning a new thread
> ---------------------------------------------------------------------------------------------------
>
> Key: WW-3691
> URL: https://issues.apache.org/jira/browse/WW-3691
> Project: Struts 2
> Issue Type: Improvement
> Components: Core Interceptors
> Affects Versions: 2.2.3.1
> Reporter: Falko Modler
> Attachments: WW-3691.patch
>
>
> Every new instance of org.apache.struts2.interceptor.BackgroundProcess spawns a new Thread (see constructor), no thread pooling is used.
> Besides problems in environments where some container might need to manage the creation of threads, this issue also prevents certain performance/efficiency optimizations via ThreadLocal from taking full effect. E.g.: We use ThreadLocals for Random and SimpleDateFormat and those thread local instances "are lost" when a new Thread is created.
> Therefore BackgroundProcess should be given a new constructor that takes a java.util.concurrent.Executor instance that is used to execute the Runnable.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira