• Post Reply Bookmark Topic Watch Topic
  • New Topic

What are the informations to be passed to a thread?

 
Thanuja Vishwanath
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I was asked this in an interview.

In a multithreaded application what are the informations would you pass to a thread so that application processes particular threads request . For Eg: in an banking application mutliple users will request for their account balance verification.

In this case what are the informations to be sent to a thread so that our application process gets each request and process it and sends response to their respective request.
 
Sandeep Sanaboyina
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I seriously doubt there will be a particular answer for this kind of a question.
What you pass to a thread will depend on what the thread needs to perform its job. It could be anything.
 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i donot think there should be an answer to this Question,You can say anything related to bank.Interviewer may be trying to trick you..
you can say.

Account no.
name
Type of account
Today Date

What ever comes to your mind at that time think of ATM transaction
 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The data which we will send to the thread is totally dependent on what the thread need to perform with that data
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The whole idea of "passing information to a Thread" is bogus and an example of how sloppy wording supports sloppy thinking.

Threads just execute run() methods.

A java.lang.Thread typically gets a Runnable object when created - the object should have the data.

The exception would be a custom class extending Thread - not done very often because it results in confusing programming.

Bill

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!