• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multithreading

 
bru pe
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Why should I implement a multithreading system ?
2) If many client acces the same object, does RMI queue the different call to a method?
THANX
bru
 
Adam Roberts
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Without some sort of protection for a multithreaded enviroment, data can easily be corrupted and erroenous results returned. This is especially important in this project as dead-lock is a major concern.
2) I'm not sure quite what you're asking here but RMI does NOT 'queue' requests to a method or an object, this is why you need threadsafety!
Hope that helps
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As to why should you do it, Allen Holub in 'Taming Java Threads' makes the point that if you have a GUI, you already have a multithreaded system. The very nature of the awt/swing libraries is such that you are very likely to have 1 or more threads dealing with event processing. The question isn't why, but:
1) how much concurrency protection do I need?
2) do I need to create even more threads?
Practically, if you have a GUI and as a result of some event would want to cause a long computation or an I/O operation that could block (or anything else that causes a thread to become not runnable), you need to deal with multithreading.
 
Jason Boutwell
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"As to why should you do it, Allen Holub in 'Taming Java Threads' makes the point...."
That is a superb book, BTW. Highly recommended for those who already have a basic grasp of threading and want to look at more specific problems and solutions.
-- jason
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic