Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #22533 > unrolled thread
| Started by | bob smith <bob@coolfone.comze.com> |
|---|---|
| First post | 2013-02-26 07:51 -0800 |
| Last post | 2013-02-28 16:52 -0500 |
| Articles | 6 — 5 participants |
Back to article view | Back to comp.lang.java.programmer
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
| From | bob smith <bob@coolfone.comze.com> |
|---|---|
| Date | 2013-02-26 07:51 -0800 |
| Subject | Thread queue |
| Message-ID | <41750994-c932-4206-b1e6-b0f21dea16d5@googlegroups.com> |
Is there some kind of system in Java where you can put Thread objects on a queue and they get executed in sequence? Thanks.
[toc] | [next] | [standalone]
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Date | 2013-02-26 11:00 -0500 |
| Message-ID | <kgim51$q6v$1@dont-email.me> |
| In reply to | #22533 |
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
[toc] | [prev] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2013-02-26 19:08 -0500 |
| Message-ID | <512d4e66$0$293$14726298@news.sunsite.dk> |
| In reply to | #22533 |
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? Call them sequentially instead of starting them?? Arne
[toc] | [prev] | [next] | [standalone]
| From | Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> |
|---|---|
| Date | 2013-02-27 13:00 +0100 |
| Message-ID | <kgksef$ngk$1@dont-email.me> |
| In reply to | #22533 |
On 26/02/2013 16:51, bob smith allegedly wrote: > Is there some kind of system in Java where you can put Thread objects on a queue and they get executed in sequence? > > Thanks. You're confusing things here. Threads are not things that get executed (at least not as far as the JVM is concerned). Threads are the things that *execute*. *Runnable*s or *Callable*s are the things that get executed. Yes, you can certainly put Runnables or Callables in a queue and have them be executed sequentially. As mentioned by someone else in this thread, the java.util.concurrent package is the place you'll want to look. -- DF.
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2013-02-28 11:22 -0800 |
| Message-ID | <5jbvi8lt78mustr3g9964vhm12v1hjsgp5@4ax.com> |
| In reply to | #22533 |
On Tue, 26 Feb 2013 07:51:51 -0800 (PST), bob smith <bob@coolfone.comze.com> wrote, quoted or indirectly quoted someone who said : >Is there some kind of system in Java where you can put Thread objects on a queue and they get executed in sequence? see http://mindprod.com/jgloss/thread.html then buy the book with the three trains on the cover. -- Roedy Green Canadian Mind Products http://mindprod.com One thing I love about having a website, is that when I complain about something, I only have to do it once. It saves me endless hours of grumbling.
[toc] | [prev] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2013-02-28 16:52 -0500 |
| Message-ID | <512fd18e$0$289$14726298@news.sunsite.dk> |
| In reply to | #22630 |
On 2/28/2013 2:22 PM, Roedy Green wrote: > On Tue, 26 Feb 2013 07:51:51 -0800 (PST), bob smith > <bob@coolfone.comze.com> wrote, quoted or indirectly quoted someone > who said : >> Is there some kind of system in Java where you can put Thread objects on a queue and they get executed in sequence? > > see http://mindprod.com/jgloss/thread.html > > then buy the book with the three trains on the cover. I don't think they really covers running things sequentially! Arne
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web