What do you think of this Design for Multiple Threads

Hi Java Experts ;
I'm curious to know what you think about this design for a multhreaded app i'm working on.
I have a controller thread that (a.) creates threads and (b.) keeps a reference to threads that it creates (by sticking them in a hashtable along with the generated Id for that thread).
When a created thread completes its job, it decrements the thread counter and removes its reference from the hashtable before it finishes its run method.
Now here's the interesting part in my controller thread i'm creating new threads on the fly with this infinite loop
     public void run(){
          while(true){
               try{
                    Thread.sleep(500);
               }catch(InterruptedException e){
               if(threadCounter<maxThreadCount && moreJobsToDo.size()>0){
                    createDomainThread();
          }//end while
what do you think about this pattern ? My goal is to maintain about 200+ created threads running at all times with this pattern.

jeff kesslerman's book says about threads
"5.2.3 Threads
The impact that threads have on RAM footprint isn't a problem for most programs, but running threads do need space to store their stack state, and the system- specific data structures do consume memory.
Because runtime implementations vary widely in how threads are handled, you might encounter situations where the impact threads have on footprint is significant. For example, some ports of the JRE create a heavyweight OS process for each running thread. In an application that uses many threads, this means that thread costs, rather than class or object costs, can become the dominant factor in the program's memory consumption.
You shouldn't avoid using threads-they're necessary in many cases, and generally don't have a large impact on footprint. However, you should be aware that the impact can be very different across runtimes. This is one of the reasons it's a good idea to measure performance characteristics under your program's different target environments. "
Question #1: how does garbage collection go about clearing the stack state, and the system- specific data structures that consume memory.
Question #2: in my situation, each worker thread's activity is not as brief as a simple server request. Each thread does a lot work and does a lot of network connections. on average I would say 100 http request - each of which can be easily blocked or delayed significantly. Therefore each worker thread may operate for between 2 - 10 minutes.
Do you think thread pooling is useful in this situation ?
stev

Similar Messages

  • What do you think of this plan for a DVD?

    In order to avoid problems with the interaction between the TITLE and MENU remote buttons I've reported in http://discussions.apple.com/thread.jspa?threadID=2151541&tstart=0 and further problems with the remote RETURN button, I am considering designing my DVD as follows:
    Main menu with four buttons:
    1) Play track 1
    2) Play track 2 with audio stream 1
    3) Go to chapter menu
    4) Play story in track 2 with audio stream 2
    Chapter menu with a button for each chapter and a button to return to the main menu
    Disable remote TITLE button in both menus, both tracks, and the story
    Set remote RETURN button in main menu to go to chapter menu
    Set remote RETURN button in chapter menu to go to main menu and highlight button 3
    What do you think? Is it weird that the remote TITLE button would be disabled? Is it weird that the remote RETURN button would go down from the main menu to the chapter menu?
    John Link

    Best book on the market.  The Apple Pro Training Series are what we use for Apple authorized certification training. The author also has fantastic video training at Ripple Training. 

  • What do you think of this case

    What do you think of this case. Would it work good as a modder for a water cooling system? what do you think?
    http://www.newegg.com/app/ViewProductDesc.asp?description=11-125-462&depa=1
    thanks

    you can't go wrong with chenming... the styling is obvious, why pay more for an antec...
    wonk will tell you antec doens't make its own stuff....
    i guess this means chen ming makes Antec Cases... lol makes sense... chen ming has always been an awesome case
    just so cheap compared to an antec
    EDIT: LOOOOL i found a really good one:
    Chenming Charcoal Black Entry level server case
    ANTEC Black Performance Series II SOHO File Server Tower ATX Case
    look familiar? lol antec=losers

  • What do you think of this assembly?

    What do you think of this assembly?

    you can't go wrong with chenming... the styling is obvious, why pay more for an antec...
    wonk will tell you antec doens't make its own stuff....
    i guess this means chen ming makes Antec Cases... lol makes sense... chen ming has always been an awesome case
    just so cheap compared to an antec
    EDIT: LOOOOL i found a really good one:
    Chenming Charcoal Black Entry level server case
    ANTEC Black Performance Series II SOHO File Server Tower ATX Case
    look familiar? lol antec=losers

  • What do you think about this article?

    What do you think about this article?
    +"A lithium-ion battery provides 300-500 discharge/charge cycles. The battery prefers a partial rather than a full discharge. Frequent full discharges should be avoided when possible. Instead, charge the battery more often or use a larger battery. There is no concern of memory when applying unscheduled charges"+
    Seems to make sense..
    I knew that lithium-ion batteries have no memory concerns, but still I thought that it was a good idea to charge and discharge the battery of a new iPod (or laptop) at least the first time..
    Any thoughts?
    Message was edited by: acidbahia

    The reason it's sometimes recommended to do a full discharge/charge cycle on a new device is to calibrate the battery indicator. It doesn't do anything for the battery itself.
    The quote you've given agrees with everything I've been taught about lithium-ion batteries.

  • What do you think about this product ?

    Hi,
    I want to have access to SAP ECC 6.0 for personnal use, so I find a hard drive in the following web site :
    http://www.erpselftraining.com/product/SAP-server-MCOD.html
    Please can you tell me what do you think about this hard drive ? has anyone already tried it ? do you advise it ?
    Your answers will be appreciated.
    Kind regards.

    is it for learning purpose ? then why dont you just download the demo versions of SAP!!

  • What do you think about our design

    Dear sir, madame,
    What do you think about our design:
    Mini Paarden shop
    Looking forward hearing your opinion.
    Kind regards,
    Mariska

    Hello Mariska,
    Browsing on an iPad, the search bar + cart Infos are hidden on the right hand side of the page (I need to scroll to see it). Depending on your target audience and the devices they uses, it might be an issue if they can't complete the order process because they don't see where the cart is...
    Apart from that, the design overall strikes me as clear enough to be browsable, IMO it does the job!

  • What do you think about Quick Office for the IPad

    What do you think about Quick Office for the IPad

    You could also have a look at the following www.rollapp.com, I have only recently found it.
    You have access to the full OpenOffice and LibreOffice library of program's  and it syncs with Dropbox,google docs and others.
    You do require an Internet connection as it is cloud based.
    At present I have only used it for quick editing but I think it definitely looks promising and it is free

  • What do you think about this software? Reliable?

    What do you think about this software? Reliable?
    http://www.macupdate.com/info.php/id/23023/filesync
    Or maybe Carbon Copy Cloner is better?
    Thanks a lot!

    I don't know Filesync, but to simply sync one folder to its backup I use SyncTwoFolders:
    http://www.versiontracker.com/dyn/moreinfo/macosx/30727
    To clone the entire hard drive to an external bootable hard disk I use SuperDuper, but CCC has an equally good reputation.

  • What do you think about using exceptions for something more than errors

    if you look the java.lang.Exception description at the JDK javadoc, you can see the following text:
    "The class Exception and its subclasses are a form of Throwable that indicates conditions that a reasonable application might want to catch."
    ... we can�t see "error" word anywhere!!
    What do you think about using exceptions for something more than errors? Can be possible use them as a way for send information to upper layers?
    Thankx in regards...

    it seems that what you say is a functional way of achiveing that, yes
    but Exceptions are generally reserverd for "Exceptional" situations ie program messing up or invalid data
    it does require a fair bit of processor time to actually generate and throw an Exception.
    so, all in all its "better" to use "normal" condition flow control to achive what you want.. you can always return early, break loops, call methods to pass information

  • What do you think of this book: "Programming and Problem Solving with Java"

    Hello Everyone:
    This may be a strange post but I am wondering if anyone has read this book and what do you think of it?
    Book Information
    Title: Programming and Problem Solving with Java
    Authors: Neell Dale, Chip Weens, Mark Headington
    Publisher: Jones & Bartlett
    Thanks for any comments

    No believe me the book is bad! The only reason I asked is I am in a university class that uses those two books for there course. The author messed up on HelloWorld.java with 4 errors at compile time! How can anyone be that stupid since they are the ones who are supposed to be teaching me the fundamentals of Java. Anyhow I just wanted other people's thoughts about the books.
    Thanks again for your input.

  • What do you think of this workflow?

    I use FCP's 3-Way Color Corrector quite a bit in my editing workflow. When I send to Color I find the color-correction from FCP doesn't translate so I was thinking about exporting my video as a self-contained QuickTime and then reimporting it into FCP so my initial color-correction is "baked in." Then, make cuts at the mark of each edit and send the new timeline to Color to really treat the footage. What do you think?

    I've found myself in the same boat. It is too bad the 3-Way Color Corrector values don't translate exactly to Color -- even close would be nice . Your proposed workflow runs the risk of adding exponential time to the post production process. I'd just take some time to match the looks from FCP in Color, then make grades out of them. jkorosi has an excellent point that by "baking in" the look, you may be limiting yourself in Color. It's an incredibly powerful app, and IMHO, is more capable of properly handling original footage. For example, losing Color's nuisance and ability to manipulate depth and detail in tonality because you baked in contrast, seems like a mistake.

  • What do you think of this vector based illustration that I made?

    TTell me what I need to work on and how. Thanks in advance.

    Your trace over the image is fairly accurate as regards the trace. Here I removed most of the color and laid it over the photo.
    Your treatment of the subject is flat, uninspiring, don't ya think?
    One way of rectifying that is to use mesh fills so you can add highlights, darker regions and "easily" modify them as you go. This would give the drawing some dimension. You could also go for making a bazillion polygons to go for a more modernistic interpretation.
    But we have no idea of what you are wanting to achieve. It would be easier (and more time effective on our part), if you pointed to similar drawings that you wanted to emulate. Else we could give a hundred ways of drawing it that do not fit your goals, whatever they are.
    Mike

  • What do you think of this mixing?

    This is the first time I've tried mixing using EQ and compression. I'm not going for a Grammy here, but I need to know it doesn't sound entirely amateur. What does everyone think? Thanks for your input.
    EDIT: Accidentally posted this early, uploading MP3 now...
    Message was edited by: rsherid

    A good mix. Nice and clean and has a good sense of the auditory field (good stereo range). Bass drum for a dance track is pretty weak. It's good sounding so it's not the mix per se but it didn't have the thump you'd want to for a club dance mix. I have a nice, high end sub system as one of my out put choice and no matter how much I turn up the bas, it didn't thump like I'd want to see. You have to think in terms of how it would sound over a clubs PA. Is it going to make peoples backsides move. I'm sure you know that better than me since it's the kind of stuff you like. Still, that kick drum as to thump. Might be because I was on a boat launch last night that has a dance club and was listening to dance mixes half the night but to folks moving, it's gotta be pumpin'.
    Depending on what you used for the drum sample/track, I'd duplicate the track. If it is a 'full drum set' track but the elements of the drum sample/track are editible, duplicate the track a couple of time and strip away all but the kick drum and start EQing only that.

  • What do you think of this printer?

    Hi all new to this
    What i was looking for is what do people think of xerox as digital printers for instance the xerox 242 whats it like? Anyone had any experience of using xerox digital printers?
    thanks in advance
    erminza

    Well this is a place you can find reviews:
    http://www.office.xerox.com/multifunction-printer/color-multifunction/docucolor- 242-252-260/news-enus.html
    It essentially is a color laser multifunction machine.
    The advantage of such machines is the speed of reproduction.
    The disadvantage is that drums can make cost of maintenance especially high when compared to inkjets. If the purpose of it is to make color photos that last a long time, an inkjet may be better for you. If you are in a mass production office, having a color Xerox machine can be very good.

Maybe you are looking for

  • Downloading file from application server in Binary mode

    Hi, I am trying to read an application server file using open dataset in Binary Mode.. While downloading using gui_download method the file is getting truncated because of its size. My questions are,        How to increase the size of the internal ta

  • Windows live on windows 7 contact sync with iPhone 4

    I have an iPhone 4 and have windows Live mail on my windows 7 PC. I am trying to sync my contacts with my iPhone from windows live mail to my iPhone. I have itunes installed but itunes does not find windows live as a contact sync app. Any ideas?

  • Report server not working

    Hi, I am using "x86_forms_reports_101202". I have defined a new report server and it has been working properly but today, when trying to run a report, the form from which i am running it, does not repond. I have restarted both the services and the se

  • Blank document when converting PDF problem

    when converting a pdf to word doc it is blank, what can i do to see it?

  • Third Party Vendor - Start Up

    We are starting to use third party vendors and payroll has been running for a year. Is there a way to pay 2009 first quarter taxes using third party vendors without payting the benefit vendors, other vendors, or garnishment vendors?  I tried to run t