Re: ThreadPoolExecutor backport
- From: Lew <com.lewscanon@lew>
- Date: Thu, 31 Jul 2008 09:19:43 -0400
Philipp wrote:
I'm using the backport to java 1.4 of Doug Lea's java.util.concurrent
Just out of curiosity, why are you stuck with an obsolete version of Java?
package. In the doc for ThreadPoolExecutor, there is a snipped of code
It's "snippet". "Snipped" is the past participle of "to snip".
to build a pausable thread pool executor. The snipped is below.
Q: Why does the boolean flag isPaused need not be volatile?
As I see it, it will be polled and set by different threads and
nothing guarantees a memory barrier.
Nothing but the 'pauseLock.lock()', that is.
Q2: Does it make a difference if you are in the 1.4 or java [sic] 5
memory model?
Yes, but not to this snippet.
--
Lew
.
- Follow-Ups:
- Re: ThreadPoolExecutor backport
- From: Robert Klemme
- Re: ThreadPoolExecutor backport
- From: Philipp
- Re: ThreadPoolExecutor backport
- References:
- ThreadPoolExecutor backport
- From: Philipp
- ThreadPoolExecutor backport
- Prev by Date: Re: What does "persist" really mean ?
- Next by Date: Re: What does "persist" really mean ?
- Previous by thread: ThreadPoolExecutor backport
- Next by thread: Re: ThreadPoolExecutor backport
- Index(es):
Relevant Pages
|