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


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

Re: Thread queue

Path csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail
From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Thread queue
Date Tue, 26 Feb 2013 11:00:32 -0500
Organization A noiseless patient Spider
Lines 14
Message-ID <kgim51$q6v$1@dont-email.me> (permalink)
References <41750994-c932-4206-b1e6-b0f21dea16d5@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Tue, 26 Feb 2013 15:59:29 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="0d73d8cc209bff1c6395088b400d0605"; logging-data="26847"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/RsXPJrukaAwNyUhOO/PaP"
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130215 Thunderbird/17.0.3
In-Reply-To <41750994-c932-4206-b1e6-b0f21dea16d5@googlegroups.com>
Cancel-Lock sha1:ao8V5UVr2eiZ6EjO3auFoP08ZQY=
Xref csiph.com comp.lang.java.programmer:22534

Show key headers only | View raw


On 2/26/2013 10:51 AM, bob smith wrote:
> Is there some kind of system in Java where you can put Thread objects on a queue and they get executed in sequence?

     You could certainly *do* that, daft though it seems.  It would
be more usual to put "work units" on a queue and let "worker threads"
take them off and execute them.  The java.util.concurrent package
offers various tools for managing concurrent execution -- although
since you say "in sequence," it's not clear that concurrency would
be welcome.  I guess you could use Executors.newFixedThreadPool(1)
and submit your tasks to pool's lone worker thread ...

-- 
Eric Sosman
esosman@comcast-dot-net.invalid

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


Thread

Thread queue bob smith <bob@coolfone.comze.com> - 2013-02-26 07:51 -0800
  Re: Thread queue Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-02-26 11:00 -0500
  Re: Thread queue Arne Vajhøj <arne@vajhoej.dk> - 2013-02-26 19:08 -0500
  Re: Thread queue Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-02-27 13:00 +0100
  Re: Thread queue Roedy Green <see_website@mindprod.com.invalid> - 2013-02-28 11:22 -0800
    Re: Thread queue Arne Vajhøj <arne@vajhoej.dk> - 2013-02-28 16:52 -0500

csiph-web