IT Community - Software Programming, Web Development and Technical Support

what is thread safe in java?

This is a discussion on what is thread safe in java? within the Java Programming forums, part of the Software Development category; when i read java articales or books i often read thread safe in servlets. what is the meaning for thread ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > Java Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-23-2008, 09:12 PM
saravanan saravanan is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Posts: 181
saravanan is on a distinguished road
Default what is thread safe in java?

when i read java articales or books i often read thread safe in servlets. what is the meaning for thread safe give me a example program for thread safe?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-26-2008, 01:08 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 323
amansundar is on a distinguished road
Default Re: what is thread safe in java?

In computer programming, thread-safe describes a program portion or routine that can be called from multiple programming threads without unwanted interaction between the threads. (A thread is an instance of the program running on behalf of some user or process.) Thread safety is of particular importance to Java programmers, since Java is a programming language that provides built-in support for threads. By using thread-safe routines, the risk that one thread will interfere and modify data elements of another thread is eliminated by circumventing potential data race situations with coordinated access to shared data.

It is possible to ensure that a routine is thread-safe by:

1. Making sure that concurrent threads use synchronized algorithms that cooperate with each other.
2. Confining the address of a shared object to one thread whenever an unsynchronized algorithm is active..
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VSS is Virtual Source Safe? devarajan.v Software Testing 1 08-17-2007 10:31 PM
safe mode simplesabita Operating Systems 1 08-11-2007 01:05 AM
What is daemon thread and How to create the daemon thread Java? bluesky Java Programming 1 07-25-2007 04:55 AM
Start Windows in Safe Mode Jeyaseelansarc Microsoft 0 05-23-2007 09:58 PM
Safe Dropshipping tripnautic eCommerce 0 03-20-2007 07:41 PM


All times are GMT -7. The time now is 12:00 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0