Forums Register Login

Multi-Threading

+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
"JavaHunter_AjayPT",
Please check your private messages regarding an important administrative matter.
-Ben
Those cherries would go best on cherry cheesecake. Don't put those cherries on this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 561 times.
Similar Threads
First Post
MaximumThroughput- MltiThreading - Need help
Static Methods in Java
Thread question
Any reason to synchronize a run method?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:53:07.