Results 1 to 7 of 7
  1. #1
    krishanu is offline Member
    Join Date
    May 2011
    Posts
    20
    Rep Power
    0

    Default 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!!!!!!!!

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    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.

  3. #3
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    A continuation of an earlier thread.

  4. #4
    krishanu is offline Member
    Join Date
    May 2011
    Posts
    20
    Rep Power
    0

    Default

    Hi Pbrockya2,

    yes...But we have used ThreadPool Executor service...By want to create my own ThreadPool executor class.

  5. #5
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    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?

  6. #6
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    want to create my own ThreadPool executor class
    So, go ahead and create it.

    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.

  7. #7
    krishanu is offline Member
    Join Date
    May 2011
    Posts
    20
    Rep Power
    0

    Default

    Hi,

    This is just want to understand how thread pool works....

    Sorry if i put question in wrong way!!!!!!!

Similar Threads

  1. Question about threadpool
    By waleed.k.omran in forum Threads and Synchronization
    Replies: 1
    Last Post: 02-25-2009, 03:48 PM
  2. Best way to implement a timer
    By Nuluvius in forum New To Java
    Replies: 11
    Last Post: 01-16-2009, 02:27 AM
  3. how to implement interface
    By makpandian in forum New To Java
    Replies: 1
    Last Post: 12-09-2008, 03:39 PM
  4. Using jakarta-commons threadpool (Tomcat) through JNDI
    By zrrbite in forum Advanced Java
    Replies: 0
    Last Post: 12-14-2007, 01:47 PM
  5. How can we implement IPC in java
    By samson in forum Networking
    Replies: 1
    Last Post: 04-04-2007, 07:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •