• Post Reply Bookmark Topic Watch Topic
  • New Topic

MulthiThreading  RSS feed

 
Gangireddy Danam
Ranch Hand
Posts: 32
Java Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell me some situations ,where in realtime examples the multithreading and polymorphims is used...also define the situations.I know the concepts but being learner i want realtime programming scenario's.
 
nithin chinni
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Multi Threading: Assume in a web application during web requests, each request can be taken as a thread. The reason behind breaking into multiple threads is, if the requests are put in a queue and processed in a first come first serve basis then the the consumer will need to wait until his request is being processed. This is fine if there are less requests. Assume how many hits google.com is going to get for every second. This is one of the example in real time why we use multithreading.

Polymorphism: The reason why we use polymorphism is to generalize an implementation so that both client and server will handle the same object so you dont need to change most of the implementation. Assume a caluculator app that you have created for your desktop. To get the response you are making a call to a web application. So if there is an object with the name "Calculate" and your desktop sends the same object to the web app even though you add, substract, multiply, divide then the code duplication will be reduced. Also in future if you want to implement "%" in your calculator you dont need to change much of the implementation neither do the web app.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!