File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Threads and Synchronization and the fly likes Implications of a singleton Thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Implications of a singleton Thread" Watch "Implications of a singleton Thread" New topic

Implications of a singleton Thread

adithya narayan
Ranch Hand

Joined: Jan 05, 2009
Posts: 79

I was just thinking of making a single object of a thread i.e. a singleton so that i have made just a single Thread object in my entire application.
Its job will be same whenever i call. The purpose of doing it is simple. I don't want to make the process run in the main application thread.

I also would like to synchronize the job (work done by runnable) if the job is called from multiple locations.

I wanted to know how good this design will be and what can be the pros and cons of it ?
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2904

I did not get your question completely, but try using below method from executor.

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
I agree. Here's the link:
subject: Implications of a singleton Thread
It's not a secret anymore!