Results 1 to 2 of 2
Thread: threads
- 12-10-2011, 02:15 AM #1
Member
- Join Date
- Nov 2011
- Posts
- 47
- Rep Power
- 0
- 12-10-2011, 03:12 AM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
Re: threads
Yes, you could not extend it, but use it as-is passing an instance of Runnable to its constructor. See Defining and Starting a Thread in Oracle's Tutorial.Is there an alternative to extending class Thread for producing threadable code?
That section of the Tutorial also discusses using Executor interfaces - again pass them a Runnable and it gets run. The Executor may well do things like maintain pools or worker threads (so you don't have to).
Similar Threads
-
New to threads
By armyson in forum Threads and SynchronizationReplies: 0Last Post: 12-09-2011, 07:52 AM -
Threads per Connection or Threads per Request
By Felic in forum New To JavaReplies: 4Last Post: 11-22-2011, 09:15 PM -
threads
By brindha1688 in forum New To JavaReplies: 3Last Post: 05-24-2011, 08:07 PM -
Threads
By Tanuck in forum New To JavaReplies: 5Last Post: 09-21-2010, 02:44 AM -
Threads!
By rameshraj in forum Advanced JavaReplies: 1Last Post: 05-04-2008, 04:11 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks