You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by "Noel J. Bergman" <no...@devtech.com> on 2003/05/18 04:24:42 UTC

ThreadPool(Manager) with hard limits (was: Phoenix 4.0.x release?)

> Chuck a patch back at us dude - into excalibur-pool & excalibur-thread ?

You don't want my code.  I just cloned ancient versions of your code, half
of them out of attics, to coggle together a ThreadManager for the version of
Phoenix we are shipping with James v2.  When there finally is a new RELEASE
of the Avalon packages suitable for James, I will want to kill off our
package.

see:
http://cvs.apache.org/viewcvs/jakarta-james/src/java/org/apache/james/util/t
hread/?only_with_tag=branch_2_1_fcs.

------
Instructions:

All that you do is clone DefaultThreadPool and create
HardResourceThreadPool.  Change the instantiation from
SoftResourceLimitingPool to HardResourceLimitingPool.  MAKE SURE that you
copy the nasty hack that I had to add, or fix the inconsistent
initialization of your pool classes.  Then clone DefaultThreadManager to
create HardResourceThreadManager, and have it instantiate a
HardResourceThreadPool instead of a DefaultThreadPool.

Since you will be working in your own packages, and therefore won't run into
the package permission problems, you won't need the other classes I had to
clone.  If you take the easy way out, this is 5 minutes worth of work, and
that's only if you're using vi.  In Emacs, it would be 60 seconds, tops.
------

Ideally, all of that could be avoided by changing DefaultThreadPool and
DefaultThreadManager to be configurable to the particular type of underlying
resource pool.  But I have enough code to work on.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: ThreadPool(Manager) with hard limits

Posted by Leif Mortenson <le...@tanukisoftware.com>.
Noel J. Bergman wrote:

>>You still could chuck a patch at us dude ;-)  Just from HEAD of relevent
>>modules.
>>    
>>
>
>If Leif Mortenson's ResourceLimitingThreadManager does what it claims (if
>not, I'll assume that it is just a bug), then that is the right solution.
>Mine was just a hack.  When the new Avalon Release cycle is finished, we can
>just adopt his new manager into James.
>
Ok let me know if there are any problems.  Cc me directly.  It is hard 
to keep up
with all the traffic on the list and some messages get by me when I get 
busy.
I miss the phoenix, etc lists.

Cheers,
Leif



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


RE: ThreadPool(Manager) with hard limits

Posted by "Noel J. Bergman" <no...@devtech.com>.
> You still could chuck a patch at us dude ;-)  Just from HEAD of relevent
> modules.

If Leif Mortenson's ResourceLimitingThreadManager does what it claims (if
not, I'll assume that it is just a bug), then that is the right solution.
Mine was just a hack.  When the new Avalon Release cycle is finished, we can
just adopt his new manager into James.

[Thanks, Leif.  :-)]

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: ThreadPool(Manager) with hard limits

Posted by Paul Hammant <Pa...@thoughtworks.net>.
Noel,

You still could chuck a patch at us dude ;-)  Just from HEAD of relevent 
modules.

- Paul

>>Chuck a patch back at us dude - into excalibur-pool & excalibur-thread ?
>>    
>>
>
>You don't want my code.  I just cloned ancient versions of your code, half
>of them out of attics, to coggle together a ThreadManager for the version of
>Phoenix we are shipping with James v2.  When there finally is a new RELEASE
>of the Avalon packages suitable for James, I will want to kill off our
>package.
>
>see:
>http://cvs.apache.org/viewcvs/jakarta-james/src/java/org/apache/james/util/t
>hread/?only_with_tag=branch_2_1_fcs.
>
>------
>Instructions:
>
>All that you do is clone DefaultThreadPool and create
>HardResourceThreadPool.  Change the instantiation from
>SoftResourceLimitingPool to HardResourceLimitingPool.  MAKE SURE that you
>copy the nasty hack that I had to add, or fix the inconsistent
>initialization of your pool classes.  Then clone DefaultThreadManager to
>create HardResourceThreadManager, and have it instantiate a
>HardResourceThreadPool instead of a DefaultThreadPool.
>
>Since you will be working in your own packages, and therefore won't run into
>the package permission problems, you won't need the other classes I had to
>clone.  If you take the easy way out, this is 5 minutes worth of work, and
>that's only if you're using vi.  In Emacs, it would be 60 seconds, tops.
>------
>
>Ideally, all of that could be avoided by changing DefaultThreadPool and
>DefaultThreadManager to be configurable to the particular type of underlying
>resource pool.  But I have enough code to work on.
>
>	--- Noel
>  
>

-- 
http://www.thoughtworks.com -> The art of heavy lifting.
Home for many Agile-practicing, Open Source activists...



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: ThreadPool(Manager) with hard limits (was: Phoenix 4.0.x release?)

Posted by Leif Mortenson <le...@tanukisoftware.com>.
Niclas Hedhman wrote:

>On Saturday 17 May 2003 08:00 pm, Leif Mortenson wrote:
>
>>    As a side note, I fixed a leak in the head yesterday
>>    
>>
>
>Sligtly misquoted. Sorry, I couldn't help it  ;o)
>
Well I do use a wireless notebook, but this time, I meant CVS head :-)

Cheers,
Leif



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: ThreadPool(Manager) with hard limits (was: Phoenix 4.0.x release?)

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Saturday 17 May 2003 08:00 pm, Leif Mortenson wrote:

>     As a side note, I fixed a leak in the head yesterday

Sligtly misquoted. Sorry, I couldn't help it  ;o)
Niclas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: ThreadPool(Manager) with hard limits (was: Phoenix 4.0.x release?)

Posted by Leif Mortenson <le...@tanukisoftware.com>.

Noel J. Bergman wrote:

>>I have a ResourceLimitingThreadPoolService which turns the pool into
>>an object that can be configured in any of the containers directly.
>>    
>>
>
>Is that the equivalent of the ThreadManager that we need(ed)?  The
>ThreadManager is a block, which the assembly file tells the container to
>use.
>
I had been talking about the Pool implementation, rather than the
ThreadManager.  I went ahead and added a ThreadManager
implementation to Cornerstone called ResourceLimitingThreadManger
take a look at the schema-xml file for the parameters.  A detailed 
description
of the attributes can be found in the javadocs for the
ResourceLimitingThreadPool constructor:

http://avalon.apache.org/api/org/apache/avalon/excalibur/thread/impl/ResourceLimitingThreadPool.html

I don't have anything set up to easily test it out, but it was simple and
should work.  You should be able to replace DefaultThreadPool with
ResourceLimitingThreadPool in your assembly file and then set the
relevant attributes.

Cheers,
Leif


RE: ThreadPool(Manager) with hard limits (was: Phoenix 4.0.x release?)

Posted by "Noel J. Bergman" <no...@devtech.com>.
Leif,

> You also might want to take a look at the ResourceLimitingThreadPool
> from the excalibur thread project.  The underlying ResourceLimitingPool
> supports the functionality of both soft and hard limiting pools and is
more
> configurable.

So long as the behavior is right, and we can just plug the thing into the
assembly file, that's fine.

> I have a ResourceLimitingThreadPoolService which turns the pool into
> an object that can be configured in any of the containers directly.

Is that the equivalent of the ThreadManager that we need(ed)?  The
ThreadManager is a block, which the assembly file tells the container to
use.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: ThreadPool(Manager) with hard limits (was: Phoenix 4.0.x release?)

Posted by Leif Mortenson <le...@tanukisoftware.com>.
Noel,
    You also might want to take a look at the ResourceLimitingThreadPool
from the excalibur thread project.  The underlying ResourceLimitingPool
supports the functionality of both soft and hard limiting pools and is more
configurable.

    As a side note, I fixed a thread leak in the CVS head yesterday that
appeared to exist in any of the ThreadPool implementations.  Not sure
when it was introduced.  But if you test the above, you will want to use
the latest and greatest from CVS for now.

Also more to the Avalon team,
    I have a ResourceLimitingThreadPoolService which turns the pool into
an object that can be configured in any of the containers directly.  Where
are components like this supposed to exist now?  As I understand it
things like that are not supposed to exist in excalibur directly, and
cornerstone is more for Phoenix blocks.

Cheers,
Leif

Noel J. Bergman wrote:

>>Chuck a patch back at us dude - into excalibur-pool & excalibur-thread ?
>>    
>>
>
>You don't want my code.  I just cloned ancient versions of your code, half
>of them out of attics, to coggle together a ThreadManager for the version of
>Phoenix we are shipping with James v2.  When there finally is a new RELEASE
>of the Avalon packages suitable for James, I will want to kill off our
>package.
>
...
<snip>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org