You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Marcus Crafter <cr...@fztig938.bank.dresdner.net> on 2002/09/27 15:22:53 UTC
Decomissioning ActiveMonitor issue
Hi Troops,
Hope all is well.
I've been looking at an issue in ActiveMonitor today, where during
disposal of the component the current thread blocks till the monitor
thread dies (ActiveMonitor.stop()).
This causes problems in our environment because our monitor interval
is set to 30 mins, which means ActiveMonitor.stop() could take up
to 30 mins to complete due to the current thread waiting for the
monitor thread to complete.
I changed the code to do an interrupt() instead of a join(), ie. to
interrupt the monitor thread out of it's sleep(), and everything worked
fine. The actual diff is below.
Just wondering if there are any issues or problems with this change
that I'm not aware of ? If so, any ideas how to fix the original
problem ?
Cheers,
Marcus
Index: src/java/org/apache/avalon/excalibur/monitor/impl/ActiveMonitor.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/monitor/src/java/org/apache/avalon/excalibur/monitor/impl/ActiveMonitor.java,v
retrieving revision 1.3
diff -u -r1.3 ActiveMonitor.java
--- src/java/org/apache/avalon/excalibur/monitor/impl/ActiveMonitor.java 8 Sep 2002 00:02:45 -0000 1.3
+++ src/java/org/apache/avalon/excalibur/monitor/impl/ActiveMonitor.java 27 Sep 2002 13:15:14 -0000
@@ -80,7 +80,7 @@
throws Exception
{
m_keepRunning = false;
- m_monitorThread.join();
+ m_monitorThread.interrupt();
}
public final void run()
--
.....
,,$$$$$$$$$, Marcus Crafter
;$' '$$$$: Computer Systems Engineer
$: $$$$: ManageSoft GmbH
$ o_)$$$: 82-84 Mainzer Landstrasse
;$, _/\ &&:' 60327 Frankfurt Germany
' /( &&&
\_&&&&'
&&&&.
&&&&&&&:
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Decomissioning ActiveMonitor issue
Posted by Peter Donald <pe...@apache.org>.
On Fri, 27 Sep 2002 23:58, Chad Stansbury wrote:
> I'd recommend a short-term solution using both - first try to join() with a
> timeout so that if it's not simply sleeping, it'll give the thread a chance
> to complete whatever it's doing, and finally, after the timeout, issuing
> the interrupt() since you can more safely assume that the thread is in a
> sleep state...
+1
And if you want to go for bonus marks make the behaviour configurable ;)
--
Cheers,
Peter Donald
------------------------------------------------------------
militant agnostic: i don't know, and you don't know either.
------------------------------------------------------------
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Decomissioning ActiveMonitor issue
Posted by Leo Sutic <le...@inspireinfrastructure.com>.
Interrupt will only work when the thread is in a sleep state.
You can not interrupt a thread that is not sleeping.
This is because interrupting threads that are doing something else
is liable to destroy *something*.
I'd go for an interrupt() followed by a join(). Kick it so it starts
running again (get out of the wait()), and wait for it to finish.
/LS
> From: Chad Stansbury [mailto:stansburyc@earthlink.net]
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Decomissioning ActiveMonitor issue
Posted by Chad Stansbury <st...@earthlink.net>.
I'd recommend a short-term solution using both - first try to join() with a
timeout so that if it's not simply sleeping, it'll give the thread a chance
to complete whatever it's doing, and finally, after the timeout, issuing the
interrupt() since you can more safely assume that the thread is in a sleep
state...
The better (but more involved) solution would require the ability to monitor
the 'state' of the ActiveMonitor so that you can tell if it's sleeping or
actually doing something - but you have to implement it carefully to avoid
race conditions.
Chad
----- Original Message -----
From: "Marcus Crafter" <cr...@fztig938.bank.dresdner.net>
To: "Avalon Mailing List" <av...@jakarta.apache.org>
Sent: Friday, September 27, 2002 7:22 AM
Subject: Decomissioning ActiveMonitor issue
> Hi Troops,
>
> Hope all is well.
>
> I've been looking at an issue in ActiveMonitor today, where during
> disposal of the component the current thread blocks till the monitor
> thread dies (ActiveMonitor.stop()).
>
> This causes problems in our environment because our monitor interval
> is set to 30 mins, which means ActiveMonitor.stop() could take up
> to 30 mins to complete due to the current thread waiting for the
> monitor thread to complete.
>
> I changed the code to do an interrupt() instead of a join(), ie. to
> interrupt the monitor thread out of it's sleep(), and everything worked
> fine. The actual diff is below.
>
> Just wondering if there are any issues or problems with this change
> that I'm not aware of ? If so, any ideas how to fix the original
> problem ?
>
> Cheers,
>
> Marcus
>
> Index:
src/java/org/apache/avalon/excalibur/monitor/impl/ActiveMonitor.java
> ===================================================================
> RCS file:
/home/cvs/jakarta-avalon-excalibur/monitor/src/java/org/apache/avalon/excali
bur/monitor/impl/ActiveMonitor.java,v
> retrieving revision 1.3
> diff -u -r1.3 ActiveMonitor.java
> --- src/java/org/apache/avalon/excalibur/monitor/impl/ActiveMonitor.java 8
Sep 2002 00:02:45 -0000 1.3
> +++ src/java/org/apache/avalon/excalibur/monitor/impl/ActiveMonitor.java
27 Sep 2002 13:15:14 -0000
> @@ -80,7 +80,7 @@
> throws Exception
> {
> m_keepRunning = false;
> - m_monitorThread.join();
> + m_monitorThread.interrupt();
> }
>
> public final void run()
>
>
> --
> .....
> ,,$$$$$$$$$, Marcus Crafter
> ;$' '$$$$: Computer Systems Engineer
> $: $$$$: ManageSoft GmbH
> $ o_)$$$: 82-84 Mainzer Landstrasse
> ;$, _/\ &&:' 60327 Frankfurt Germany
> ' /( &&&
> \_&&&&'
> &&&&.
> &&&&&&&:
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Decomissioning ActiveMonitor issue
Posted by Marcus Crafter <cr...@fztig938.bank.dresdner.net>.
Thanks for applying the patch Peter! :)
Thanks for a better patch Greg! :)
Cheers,
Marcus
On Mon, Sep 30, 2002 at 07:37:23PM +1000, Peter Donald wrote:
> Looks good to me - Applied!
>
> On Sat, 28 Sep 2002 03:19, Greg Steuck wrote:
> > Hi Marcus,
> >
> > >>>>> "Marcus" == Marcus Crafter <cr...@fztig938.bank.dresdner.net>
> > >>>>> writes:
> >
> > Marcus> This causes problems in our environment because our
> > Marcus> monitor interval is set to 30 mins, which means
> > Marcus> ActiveMonitor.stop() could take up to 30 mins to complete
> > Marcus> due to the current thread waiting for the monitor thread
> > Marcus> to complete.
> >
> > Marcus> I changed the code to do an interrupt() instead of a
> > Marcus> join(), ie. to interrupt the monitor thread out of it's
> > Marcus> sleep(), and everything worked fine. The actual diff is
> > Marcus> below.
> >
> > But it shouldn't work fine. InterruptedException is simply ignored by
> > delay() in the monitor thread and it resumes waiting. Could you double
> > check that your fix actually works? If it does, could you explain how?
> >
> > Marcus> Just wondering if there are any issues or problems
> > Marcus> with this change that I'm not aware of ? If so, any ideas
> > Marcus> how to fix the original problem ?
> >
> > Could somebody explain why InterruptedException is suppressed in
> > delay() and sleep is resumed by run()? It seems to be wrong: it's
> > not like somebody is running around sending InterruptedException
> > exceptions to thread and you need to ignore them. The only thing
> > that can send such exception to the monitor thread is the
> > ActiveMonitor that created it in the first place. And that exception
> > shouldn't be ignored.
> >
> > So, the patch I'm attaching:
> >
> > 1) interrupts the thread
> > 2) waits for it to terminate (Hi Chad!)
> > 3) terminates the monitor thread on InterruptedException
> > 4) declares m_keepRunning volatile since it is accessed concurrently,
> > even though it is a 4 byte entity and assignment is supposed
> > to be atomic
> >
> > The right way to handle this m_keepRunning thing would be to use a
> > Latch (e.g. from Doug Lea's util.concurrent). Any plans to integrate
> > or just use util.concurrent?
> >
> > Thanks
> > Greg
>
> --
> Cheers,
>
> Peter Donald
> ---------------------------------------------------------
> Clarke's Third Law: "Any technology distinguishable from
> magic is insufficiently advanced".
> ---------------------------------------------------------
>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
--
.....
,,$$$$$$$$$, Marcus Crafter
;$' '$$$$: Computer Systems Engineer
$: $$$$: ManageSoft GmbH
$ o_)$$$: 82-84 Mainzer Landstrasse
;$, _/\ &&:' 60327 Frankfurt Germany
' /( &&&
\_&&&&'
&&&&.
&&&&&&&:
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Decomissioning ActiveMonitor issue
Posted by Peter Donald <pe...@apache.org>.
Looks good to me - Applied!
On Sat, 28 Sep 2002 03:19, Greg Steuck wrote:
> Hi Marcus,
>
> >>>>> "Marcus" == Marcus Crafter <cr...@fztig938.bank.dresdner.net>
> >>>>> writes:
>
> Marcus> This causes problems in our environment because our
> Marcus> monitor interval is set to 30 mins, which means
> Marcus> ActiveMonitor.stop() could take up to 30 mins to complete
> Marcus> due to the current thread waiting for the monitor thread
> Marcus> to complete.
>
> Marcus> I changed the code to do an interrupt() instead of a
> Marcus> join(), ie. to interrupt the monitor thread out of it's
> Marcus> sleep(), and everything worked fine. The actual diff is
> Marcus> below.
>
> But it shouldn't work fine. InterruptedException is simply ignored by
> delay() in the monitor thread and it resumes waiting. Could you double
> check that your fix actually works? If it does, could you explain how?
>
> Marcus> Just wondering if there are any issues or problems
> Marcus> with this change that I'm not aware of ? If so, any ideas
> Marcus> how to fix the original problem ?
>
> Could somebody explain why InterruptedException is suppressed in
> delay() and sleep is resumed by run()? It seems to be wrong: it's
> not like somebody is running around sending InterruptedException
> exceptions to thread and you need to ignore them. The only thing
> that can send such exception to the monitor thread is the
> ActiveMonitor that created it in the first place. And that exception
> shouldn't be ignored.
>
> So, the patch I'm attaching:
>
> 1) interrupts the thread
> 2) waits for it to terminate (Hi Chad!)
> 3) terminates the monitor thread on InterruptedException
> 4) declares m_keepRunning volatile since it is accessed concurrently,
> even though it is a 4 byte entity and assignment is supposed
> to be atomic
>
> The right way to handle this m_keepRunning thing would be to use a
> Latch (e.g. from Doug Lea's util.concurrent). Any plans to integrate
> or just use util.concurrent?
>
> Thanks
> Greg
--
Cheers,
Peter Donald
---------------------------------------------------------
Clarke's Third Law: "Any technology distinguishable from
magic is insufficiently advanced".
---------------------------------------------------------
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Decomissioning ActiveMonitor issue
Posted by Berin Loritsch <bl...@apache.org>.
Greg Steuck wrote:
> Hi Marcus,
>
>
>>>>>>"Marcus" == Marcus Crafter <cr...@fztig938.bank.dresdner.net> writes:
>>>>>
> Marcus> This causes problems in our environment because our
> Marcus> monitor interval is set to 30 mins, which means
> Marcus> ActiveMonitor.stop() could take up to 30 mins to complete
> Marcus> due to the current thread waiting for the monitor thread
> Marcus> to complete.
>
> Marcus> I changed the code to do an interrupt() instead of a
> Marcus> join(), ie. to interrupt the monitor thread out of it's
> Marcus> sleep(), and everything worked fine. The actual diff is
> Marcus> below.
>
> But it shouldn't work fine. InterruptedException is simply ignored by
> delay() in the monitor thread and it resumes waiting. Could you double
> check that your fix actually works? If it does, could you explain how?
If he calls dispose() *before* he calls InterruptedException, then it
would work. The order is very important in this case.
>
> Marcus> Just wondering if there are any issues or problems
> Marcus> with this change that I'm not aware of ? If so, any ideas
> Marcus> how to fix the original problem ?
>
> Could somebody explain why InterruptedException is suppressed in
> delay() and sleep is resumed by run()? It seems to be wrong: it's
> not like somebody is running around sending InterruptedException
> exceptions to thread and you need to ignore them. The only thing
> that can send such exception to the monitor thread is the
> ActiveMonitor that created it in the first place. And that exception
> shouldn't be ignored.
>
> So, the patch I'm attaching:
>
> 1) interrupts the thread
> 2) waits for it to terminate (Hi Chad!)
> 3) terminates the monitor thread on InterruptedException
> 4) declares m_keepRunning volatile since it is accessed concurrently,
> even though it is a 4 byte entity and assignment is supposed
> to be atomic
>
> The right way to handle this m_keepRunning thing would be to use a
> Latch (e.g. from Doug Lea's util.concurrent). Any plans to integrate
> or just use util.concurrent?
>
> Thanks
> Greg
>
>
> ------------------------------------------------------------------------
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
- Benjamin Franklin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Wakesoft
Posted by Peter Donald <pe...@apache.org>.
On Sat, 28 Sep 2002 14:11, Gonzalo Diethelm wrote:
> Peter, thanks for taking the time to write that very enlightening reply!
> I'm asking about Wakesoft because in one of the projects I work for, a
> consultant who is usually well respected seems to be pretty excited
> about this framework; I fail to see its virtues, but before dismissing
> it I wanted to get other opinions.
If it happens to match your domain or can be customized to do so they can be
great toolkits. If it doesn't they are PITAs ;)
> > The worst development project I worked on used a similar toolkit
> > that provide
> > to be inflexible - which resulted in us doing 4-5 times more work
> > than if we
> > coded it up ourselves.
>
> Would you care to share with us the name of that toolkit?
> Or maybe via a direct message to me?
It was years ago, in C++ and came out of academia. Unfortunately it came from
someone who lacked real world experience in the domain. We weren't allowed to
dump it for political reasons ;(
> > In contrast, the best project I worked on used a similar toolkit
> > and it saved us massive amounts of time.
>
> Same thing for this: could you share the toolkit name?
It was a custom toolkit built special purpose for the project. Essentially
just read an xml document into an object model and then used that model to
perform persistence, network distribution, client side caching, replication
etc.
I doubt any specific toolkit could have done what we needed;
* versioned objects that may have "branches"
* may be distributed across multiple servers
* had specific conflict resolution rules when multiple servers synchronized
* icky mapping into relational database
* very particular clientside caching semantics
I guess it would be possible to build a generic toolkit to do this and
annotate using "attributes" and customizable transformers but I have never
had the time to do it ;) You would also need to be able to attach specific
"features" onto each object on model. ie My current project has "actions" and
"querys" associated with each object which is unique to this project.
> > My last 4.5 projects have used a MDA style
> > approach at least for certain aspects of the system and mostly
> > worked well
> > but we customized each model to specific domain.
>
> Was this using any specific framework or tools?
Not really. I recode the same thing over and over - lots of ugly copy n paste
coding. As each model tends to be relatively domain specific it tends to be
best to do it this way until a generic toolkit is found or built.
> In fact, I'm
> curious: I assume you use Avalon for most/all your projects;
> other than that, what libraries, frameworks and tools (open
> source or not) do you usually use?
I actually can't use Avalon as much as I would like to ;(
Other things I tend to use;
* velocity
* xslt
* sitemesh (on sourceforge)
* xdoclet (on sourceforge) - however I will probably migrate to qdox/vDoclet
if they can offer better stability than xdoclet.
* a customized torque
* struts (though moving away from it now).
* ant
Will eventually use OJB
> > *------------------------------------------------*
> >
> > | You can't wake a person who is pretending |
> > | to be asleep. -Navajo Proverb. |
> >
> > *------------------------------------------------*
>
> Love the sayings as well!
:)
--
Cheers,
Peter Donald
Duct tape is like the force. It has a light side, and a dark side, and
it binds the universe together ...
-- Carl Zwanzig
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Wakesoft
Posted by Gonzalo Diethelm <go...@vtr.net>.
> > Could anybody familiar with the Wakesoft Architecture Server
> > provide comments, opinions or flames regarding this framework?
> > I'm particularly interested in comparisons between this thing
> > and other frameworks, including Avalon.
> >
> > Just in case: http://www.wakesoft.com/
>
> I wasn't able to get to the meat of this framework - I kept encountering
> marketese, white papers, user reports, case studies ... arg!
Peter, thanks for taking the time to write that very enlightening reply!
I'm asking about Wakesoft because in one of the projects I work for, a
consultant who is usually well respected seems to be pretty excited
about this framework; I fail to see its virtues, but before dismissing
it I wanted to get other opinions.
> If source is generated the framework can either;
> a. Require you to subclass things to get functionality (like
> torque allowing
> subclasses of objects)
> b. Require you to modify generated code
>
> My personal preference is to avoid (b) at all costs because it is hard to
> evolve and is basically "wizards" from MS world of development.
Same here.
> Sun has one of these frameworks, I believe Oracle has one. There
> is also a
> large number of opensource ones. One that someone has recommended to me is
> http://www.javanovic.com/ which I think is a Struts centric
> version of this.
Will check it.
> The worst development project I worked on used a similar toolkit
> that provide
> to be inflexible - which resulted in us doing 4-5 times more work
> than if we
> coded it up ourselves.
Would you care to share with us the name of that toolkit?
Or maybe via a direct message to me?
> In contrast, the best project I worked on used a similar toolkit
> and it saved us massive amounts of time.
Same thing for this: could you share the toolkit name?
> My last 4.5 projects have used a MDA style
> approach at least for certain aspects of the system and mostly
> worked well
> but we customized each model to specific domain.
Was this using any specific framework or tools? In fact, I'm
curious: I assume you use Avalon for most/all your projects;
other than that, what libraries, frameworks and tools (open
source or not) do you usually use?
> Anyways this sort of framework is othogonal to Avalon. In fact
> Avalon may be a
> target of that framework (or it could use EJB SessionBeans). If
> you want to
> see how I think it should be done; search back through the Avalon mailing
> list for "Attribute Driven Development" and "Model Driven Development". A
> couple of weeks ago I was yammering on about it ;)
I'm reading those threads right now. Thanks a lot for the feedback.
> Peter Donald
> *------------------------------------------------*
> | You can't wake a person who is pretending |
> | to be asleep. -Navajo Proverb. |
> *------------------------------------------------*
Love the sayings as well!
--
Gonzalo A. Diethelm
gonzalo.diethelm@aditiva.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Wakesoft
Posted by Peter Donald <pe...@apache.org>.
Hi,
On Sat, 28 Sep 2002 10:02, Gonzalo Diethelm wrote:
> Could anybody familiar with the Wakesoft Architecture Server
> provide comments, opinions or flames regarding this framework?
> I'm particularly interested in comparisons between this thing
> and other frameworks, including Avalon.
>
> Just in case: http://www.wakesoft.com/
I wasn't able to get to the meat of this framework - I kept encountering
marketese, white papers, user reports, case studies ... arg!
However I think that I know what it probably looks like. Usually these sort of
frameworks allow you to define an application model using some high-level
modelling language (like UML or a derivative). This model is then used to
either;
1. build a database of model at runtime and use that to "interpret"
application. (ie I tend to use Commons DynaObject style classes in this sort
of case) This will also add plugin points where you can write your domain
specific services
2. generate the source code for the boiler plate code and allow you to
customize it. Ie generate the Object Model, generate the database/network
peers. Generate forms to edit objects etc.
If source is generated the framework can either;
a. Require you to subclasss things to get functionality (like torque allowing
subclasses of objects)
b. Require you to modify generated code
My personal preference is to avoid (b) at all costs because it is hard to
evolve and is basically "wizards" from MS world of development.
There is a huge number of these frameworks around. Many are very specific to
particular domains or technologies while others are more generic. Many more
are emerging to deal with things like making 2-tier or 3-tier a deploy time
concern. Using EJBs or not becomes a deployment concern etc.
Sun has one of these frameworks, I believe Oracle has one. There is also a
large number of opensource ones. One that someone has recomended to me is
http://www.javanovic.com/ which I think is a Struts centric version of this.
In Apache there is not anything like this. If you could extend the Torque xml
model and use it to gernerate RMI distribution layers, gui forms and so forth
then it may come close.
Essentially the process ends up being
Model --> Transform --> Write services == Application
(Though some frameworks also have services as part of model).
If Wakesoft allows you to extend their model, add more transforms (I think it
allows this) then it could be useful. Then it just comes down to how well it
matches your application domain.
The worst development project I worked on used a similar toolkit that provide
to be inflexable - which resulted in us doing 4-5 times more work than if we
coded it up ourselves.
In contrast, the best project I worked on used a similar toolkit and it saved
us massive amounts of time. My last 4.5 projects have used a MDA style
approach at least for certain aspects of the system and mostly worked well
but we customized each model to specific domain.
Anyways this sort of framework is othogonal to Avalon. In fact Avalon may be a
target of that framework (or it could use EJB SessionBeans). If you want to
see how I think it should be done; search back through the Avalon mailing
list for "Attribute Driven Development" and "Model Driven Development". A
couple of weeks ago I was yammering on about it ;)
--
Cheers,
Peter Donald
*------------------------------------------------*
| You can't wake a person who is pretending |
| to be asleep. -Navajo Proverb. |
*------------------------------------------------*
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Wakesoft
Posted by Robert <rm...@bull-enterprises.com>.
I'm glad you found this. We have something similar to their product and
our marketing guy has been begging me to find competitors.
I agree a lot with what Peter said, especially about wizard generated
applications and code generators. I'm NOT a fan of generators myself and
have been pushing for our product to not go that route (a tough battle I
must say). From the few minutes I spent looking at it, mostly the API, I
would agree with Peter that it is similar to what Avalon tries to do,
but at a lower, more consolidated level.
Wakesoft's seemed pretty complete, but I couldn't get a grasp on how it
was configured or anything like that. It looks pretty well thought out
and executed. Of course that doesn't mean it's a silver bullet but I
also would not say it is an incorrect or just plain bad way to go.
- Robert
-----Original Message-----
From: Gonzalo Diethelm [mailto:gonzalo.diethelm@vtr.net]
Sent: Friday, September 27, 2002 7:02 PM
To: Avalon Developers List
Subject: Wakesoft
Could anybody familiar with the Wakesoft Architecture Server
provide comments, opinions or flames regarding this framework?
I'm particularly interested in comparisons between this thing
and other frameworks, including Avalon.
Just in case: http://www.wakesoft.com/
Thanks in advance,
--
Gonzalo A. Diethelm
gonzalo.diethelm@aditiva.com
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Wakesoft
Posted by Gonzalo Diethelm <go...@vtr.net>.
Could anybody familiar with the Wakesoft Architecture Server
provide comments, opinions or flames regarding this framework?
I'm particularly interested in comparisons between this thing
and other frameworks, including Avalon.
Just in case: http://www.wakesoft.com/
Thanks in advance,
--
Gonzalo A. Diethelm
gonzalo.diethelm@aditiva.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Decomissioning ActiveMonitor issue
Posted by Greg Steuck <gr...@nest.cx>.
Hi Marcus,
>>>>> "Marcus" == Marcus Crafter <cr...@fztig938.bank.dresdner.net> writes:
Marcus> This causes problems in our environment because our
Marcus> monitor interval is set to 30 mins, which means
Marcus> ActiveMonitor.stop() could take up to 30 mins to complete
Marcus> due to the current thread waiting for the monitor thread
Marcus> to complete.
Marcus> I changed the code to do an interrupt() instead of a
Marcus> join(), ie. to interrupt the monitor thread out of it's
Marcus> sleep(), and everything worked fine. The actual diff is
Marcus> below.
But it shouldn't work fine. InterruptedException is simply ignored by
delay() in the monitor thread and it resumes waiting. Could you double
check that your fix actually works? If it does, could you explain how?
Marcus> Just wondering if there are any issues or problems
Marcus> with this change that I'm not aware of ? If so, any ideas
Marcus> how to fix the original problem ?
Could somebody explain why InterruptedException is suppressed in
delay() and sleep is resumed by run()? It seems to be wrong: it's
not like somebody is running around sending InterruptedException
exceptions to thread and you need to ignore them. The only thing
that can send such exception to the monitor thread is the
ActiveMonitor that created it in the first place. And that exception
shouldn't be ignored.
So, the patch I'm attaching:
1) interrupts the thread
2) waits for it to terminate (Hi Chad!)
3) terminates the monitor thread on InterruptedException
4) declares m_keepRunning volatile since it is accessed concurrently,
even though it is a 4 byte entity and assignment is supposed
to be atomic
The right way to handle this m_keepRunning thing would be to use a
Latch (e.g. from Doug Lea's util.concurrent). Any plans to integrate
or just use util.concurrent?
Thanks
Greg
Re: Decomissioning ActiveMonitor issue
Posted by Berin Loritsch <bl...@apache.org>.
Marcus Crafter wrote:
> Hi Troops,
>
> Hope all is well.
>
> I've been looking at an issue in ActiveMonitor today, where during
> disposal of the component the current thread blocks till the monitor
> thread dies (ActiveMonitor.stop()).
>
> This causes problems in our environment because our monitor interval
> is set to 30 mins, which means ActiveMonitor.stop() could take up
> to 30 mins to complete due to the current thread waiting for the
> monitor thread to complete.
>
> I changed the code to do an interrupt() instead of a join(), ie. to
> interrupt the monitor thread out of it's sleep(), and everything worked
> fine. The actual diff is below.
>
> Just wondering if there are any issues or problems with this change
> that I'm not aware of ? If so, any ideas how to fix the original
> problem ?
Go for it!
--
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
- Benjamin Franklin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>