What is can countdown latch do in case of a error?

View: New views
2 Messages — Rating Filter:   Alert me  

What is can countdown latch do in case of a error?

by i30817 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

So i have a master thread that has to await a serial runnable (one for
each word in a phrase) to end.
I was thinking of using a CountdownLatch instead of the wait/notify
i'm using now (and has a bug i'm trying to find),
But i don't see a way to notify the latch (and the master ofcourse) in
case of failure right?
_______________________________________________
Concurrency-interest mailing list
Concurrency-interest@...
http://cs.oswego.edu/mailman/listinfo/concurrency-interest

Re: What is can countdown latch do in case of a error?

by i30817 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Never mind, just realized a volatile field set before the latch is
counted down is enough

On Tue, Oct 20, 2009 at 2:09 AM, Paulo Levi <i30817@...> wrote:
> So i have a master thread that has to await a serial runnable (one for
> each word in a phrase) to end.
> I was thinking of using a CountdownLatch instead of the wait/notify
> i'm using now (and has a bug i'm trying to find),
> But i don't see a way to notify the latch (and the master ofcourse) in
> case of failure right?
>
_______________________________________________
Concurrency-interest mailing list
Concurrency-interest@...
http://cs.oswego.edu/mailman/listinfo/concurrency-interest