Results 1 to 7 of 7
- 06-12-2011, 06:40 AM #1
Member
- Join Date
- May 2011
- Posts
- 20
- Rep Power
- 0
How to implement my own ThreadPool ??
Hi Experts,
Can anybody tell me how to implement my own ThreadPool ?? I know Java 5 comes with built in thread pools in the java.util.concurrent package, but just want to understand how we can create our own thread pool.
Can anybody give some simple example with code??
Thanks in advance!!!!!!!!
- 06-12-2011, 07:09 AM #2
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Perhaps the tutorials, or the java.util.concurrent source code will be helpful. You can find the source files in the Jdk directory I believe.
- 06-12-2011, 07:17 AM #3
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,544
- Rep Power
- 11
A continuation of an earlier thread.
- 06-12-2011, 07:25 AM #4
Member
- Join Date
- May 2011
- Posts
- 20
- Rep Power
- 0
Hi Pbrockya2,
yes...But we have used ThreadPool Executor service...By want to create my own ThreadPool executor class.
- 06-12-2011, 07:43 AM #5
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
While it may ruin some of the learning experience, the source would show you how professionals implemented it. Why not try working on creating your own and post what you came up with?
- 06-12-2011, 07:44 AM #6
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,544
- Rep Power
- 11
So, go ahead and create it.want to create my own ThreadPool executor class
I find a couple of things a bit obscure. First you say you want "some simple example with code". But you have the code! In this thread and in the last you were pointed to java.util.concurrent. Of course you may feel that that code is not particularly simple. And it's not, because the problem itself is not simple. Were it simple I would have written java.util.concurrent myself and not have had to wait for Doug Lea to do it for me.
Secondly you say you "want to understand how we can create our own thread pool". But in the other thread you were referred to an IBM paper that talked about what is involved. The site's down now, but did you read the developerworks paper? If you have specific problems with what is said there or in the threads section of Oracle's or others tutorials, what are they?
----------
Sorry to push this, but it's looking a bit like a codezplz for a homework-with-java.util.concurrent-explicitly-excluded. If you've posted here for any length of time you'll appreciate that it's not going to happen.
Again sorry if that is not in fact the case. But if it's understanding about what a thread pool does that is what you're after, you've got lots to work on (the code, tutorials and the developerworks material), the next step is to produce specific questions.
- 06-12-2011, 08:01 AM #7
Member
- Join Date
- May 2011
- Posts
- 20
- Rep Power
- 0
Similar Threads
-
Question about threadpool
By waleed.k.omran in forum Threads and SynchronizationReplies: 1Last Post: 02-25-2009, 02:48 PM -
Best way to implement a timer
By Nuluvius in forum New To JavaReplies: 11Last Post: 01-16-2009, 01:27 AM -
how to implement interface
By makpandian in forum New To JavaReplies: 1Last Post: 12-09-2008, 02:39 PM -
Using jakarta-commons threadpool (Tomcat) through JNDI
By zrrbite in forum Advanced JavaReplies: 0Last Post: 12-14-2007, 12:47 PM -
How can we implement IPC in java
By samson in forum NetworkingReplies: 1Last Post: 04-04-2007, 06:38 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks