Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

One quick question in thread?

 
Shanmugam nagaraj
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Henry Wong
author
Marshal
Pie
Posts: 20997
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
Shanmugam nagaraj
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 20997
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok thanks...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic