aspose file tools*
The moose likes Threads and Synchronization and the fly likes One quick question in thread? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "One quick question in thread?" Watch "One quick question in thread?" New topic
Author

One quick question in thread?

Shanmugam nagaraj
Ranch Hand

Joined: May 07, 2007
Posts: 76
Hi,
what all are the scenario we will use the threads and sychronization in real time?

Please help me out for my hard question which is simple to you..

Thanks

Shanmugam


Thanks <br />Shanmugam N
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

This question is neither quick or simple... Threading is a programmer's tool. You use it, if you want concurrency in your application.

To ask for all scenarios where it is useful, is like asking for all scenarios, where you want to use a Database, or the network, or even Java.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
There's a common misuse of the term "real time" in this question, too.

"Real time" is to do with computer systems that interact with real physical processes and hence have to definitely respond within fixed time constraints. Google/Wiki/FOLDOC for more info.

I suspect the original poster meant "real-world".


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Shanmugam nagaraj
Ranch Hand

Joined: May 07, 2007
Posts: 76
Hi,
Thanks for your timely response!
My sincere appologise for the inconvinience cause to you due to my communication gap and wasted your precious time.
I am very new to java and to javaranch also, now only I trying a job also.

One interviewer asked me like:

1) What is scenario you use threads in java or what is the situation leads you to use threads?

2) real time means real time applications.

For eg: If we are creating a web application then we will use lot of classes, interfaces, jdbc connections, web application, bean, jsp, servelt xml etc...

where we will use the threads or multithreads or synchronisation?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

One interviewer asked me like:

1) What is scenario you use threads in java or what is the situation leads you to use threads?

2) real time means real time applications.

For eg: If we are creating a web application then we will use lot of classes, interfaces, jdbc connections, web application, bean, jsp, servelt xml etc...

where we will use the threads or multithreads or synchronisation?


Oh... this is an interview question. Now it makes sense.

A good interview question (of which this seems to be one) is open-ended. This means that there should not be a simple and clear answer. The interviewer wants to see how you think about using threads. What makes you use it? What do you worry about while using it? etc.

IMHO, this is a question that is best answered with experience -- meaning provide a real situation, what you actually did, and what was the result. etc.

Henry
Shanmugam nagaraj
Ranch Hand

Joined: May 07, 2007
Posts: 76
Ok thanks...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: One quick question in thread?