India,Desi,Discussion Forum Board Astrology, Jobs

Go Back   India,Desi,Discussion Forum Board Astrology, Jobs > Career and Jobs > Interview Tips and Tricks
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-08-2008, 10:16 AM
bharath bharath is offline
Member
 
Join Date: Mar 2008
Posts: 57
Default Java Interview - Multithreading.

Describe synchronization in respect to multithreading.

2. Explain different way of using thread?
Reply With Quote
  #2 (permalink)  
Old 05-10-2008, 10:05 AM
ram101 ram101 is offline
Senior Member
 
Join Date: Jun 2007
Posts: 255
Default

1.With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchonization, it is possible for one thread to modify a shared variable while another thread is in the process of using or updating same shared variable. This usually leads to significant errors.

2. The thread could be implemented by using runnable interface or by inheriting from the Thread class. The former is more advantageous, 'cause when you are going for multiple inheritance..the only interface can help.
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



AddThis Social Bookmark Button
All times are GMT. The time now is 03:54 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0