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 basic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "basic " Watch "basic " New topic


sudheer singampalli

Joined: Nov 03, 2003
Posts: 4
I am new to Java.
plz tell me what a "thread-safe" program means.
Amol Takate

Joined: Sep 20, 2003
Posts: 15
In simple words a thresd safe class or object means there is only one thread inside a object at a given point in a time.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

Amol --
No, not really, that isn't what it means.
"Thread-safe" means quite the opposite, really: it means that multiple threads can access a single resource simultaneously without harm.

[Jess in Action][AskingGoodQuestions]
subject: basic
It's not a secret anymore!