• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

SwingWorker Threads  RSS feed

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The API for SwingWorker says that it runs on a worker thread, which makes it sound like when you create multiple objects from a class that extends SwingWorker, only a limited number of threads will be created. Even in the source code, there is a constant listing a maximum number of threads.

But...

When I profile an application that creates new SwingWorkers regularly, under threads it lists an ongoing and continually expanding list of SwingWorker threads. My guess is that many have died.

Is this something to worry about? Should I use and executor to limit the number of threads available? If I create many instances of different SwingWorkers and subclass instances, will the constant defining the maximum number of worker threads apply to all the instances? (i.e. I have 4 different subclass tasks, each with 3 instances running. Will only 10, or whatever that constant is in the SwingWorker source, be running?)

Thanks,

Andy
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!