Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #29236

Re: thread pool

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: thread pool
Date 2014-07-23 11:41 -0400
Organization A noiseless patient Spider
Message-ID <lqol2t$tba$1@dont-email.me> (permalink)
References (3 earlier) <lqmhk2$pnm$1@dont-email.me> <lqmk8d$e3m$1@dont-email.me> <lqnjln$2l6e$1@ariadne.rz.tu-clausthal.de> <lqo61b$dao$1@dont-email.me> <lqof0k$2res$1@ariadne.rz.tu-clausthal.de>

Show all headers | View raw


On 7/23/2014 9:57 AM, Philipp Kraus wrote:
> On 2014-07-23 11:24:24 +0000, Eric Sosman said:
>
>
> On 7/23/2014 2:11 AM, Philipp Kraus wrote:
>
> [...]
>
> It seems, that the CountDownLatch does not work as expected. Any idea?
>
>
> Time for an SSCCE, I think. <http://sscce.org/>
>
>
> see the link https://github.com/flashpixx/threadtest (working example)

     The meaning of the first "S" seems to have eluded you ...

     I'm not going to plow through all that stuff in detail, and
(as I wrote earlier) I'm unfamiliar with ThreadGroup.  At a glance,
though, it looks like you've got bits and pieces of at least two
different synchronization schemes, perhaps more, all mixed together:
there's a CountDownLatch *and* a CyclicBarrier *and* an AtomicInteger
*and* a bunch of synchronized methods *and* the aforementioned
ThreadGroup, ...  Perhaps you've been trying to achieve parallelism
by adding more and more stuff, but it's my experience that going in
the opposite direction is more fruitful.  An American philosopher
urged us to "Simplify, simplify!" -- in an age before computers, yet
I find his advice essential to success in parallel computing.

     One thing I noticed, though I haven't analyzed things carefully
enough to be sure: You initialize the CountDownLatch with a count
of five, but six different threads call await() on it.  Surely
that can't be right, can it?


-- 
esosman@comcast-dot-net.invalid

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

thread pool Philipp Kraus <philipp.kraus@flashpixx.de> - 2014-07-22 15:00 +0200
  Re: thread pool Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-07-22 09:11 -0400
    Re: thread pool Philipp Kraus <philipp.kraus@flashpixx.de> - 2014-07-22 16:32 +0200
    Re: thread pool Philipp Kraus <philipp.kraus@flashpixx.de> - 2014-07-22 21:38 +0200
      Re: thread pool Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-07-22 16:29 -0400
        Re: thread pool Philipp Kraus <philipp.kraus@flashpixx.de> - 2014-07-22 23:01 +0200
          Re: thread pool Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-07-22 17:14 -0400
            Re: thread pool Philipp Kraus <philipp.kraus@flashpixx.de> - 2014-07-23 08:11 +0200
              Re: thread pool Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-07-23 07:24 -0400
                Re: thread pool Philipp Kraus <philipp.kraus@flashpixx.de> - 2014-07-23 15:57 +0200
                Re: thread pool Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-07-23 11:41 -0400
                Re: thread pool Philipp Kraus <philipp.kraus@flashpixx.de> - 2014-07-24 09:55 +0200
                Re: thread pool Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-07-24 08:39 -0400
  Re: thread pool Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2014-07-24 20:50 -0700

csiph-web