Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multi-Threading  RSS feed

 
Ajay P Tarachand
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have change the single thread oriented code into Multi-threaded code, but i m stucked due to some issues.I m describing briefly the flow of the code.
Execution Start from - Main method i m reading msg and passed it to method ReceiveMsg() method and that method spawns 5 the threads of piece of code that process the msg.If the thread count is equal to 5 then the another
will not generated.
Problems:-
1)since i m generating five thread if any thread hang then how would i kill it.
2)My older code contain org.apache.common.collections.LRUMap that isnt synchronized.To get its synchronized version -the way is Collection.synchronizedMap(themaptosynchronize), but when use it i.e.(Collection.synchronizedMap(new LRUMap)) it gives an typecast error "cannot convert Map to LRUMap".
3)is join method is required in my code to join the threads that i m generating in the ReceiveMsg() method.

..........please comment........................

[ April 29, 2008: Message edited by: JavaHunter_AjayPT ]
[ April 29, 2008: Message edited by: JavaHunter_AjayPT ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"JavaHunter_AjayPT",
Please check your private messages regarding an important administrative matter.
-Ben
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!