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 ]
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 ]