A multi-threaded application should have atomicity, deadlock avoidance, race condition detection. Are there any other which are necessary to be considered?
So you have also to avoid resource thrashing and thread life-cycle overhead. This comes when you have too many threads and it starts taking up all your resources. Usually the introduction of thread pools help with the resource thrashing as it spreads the load of thread creation and you get to re-use already created threads to avoid the creation overhead altogether.
There are 3 main threading approaches
1. Thread per task: Small number of long running tasks
2. Single background thread: Low priority background tasks processed in a queue
3. Thread pooling: Large number of short running tasks
There is probably others but I guess those are the ones that come to my mind off the bat.
As george said above i would like to add some thing in it
resource allocation method must be initialize very carefully either it is memory or processing.because each time when resource is going to be used there must be a provision in multi threaded application that it has to remain its stateful information unchanged while individual application comes for processing after a roundabout time.
so its kind of - I remain a checkbox unchecked and another process goes execution for same time and make it checked and , its commit appears on my execution.
its like a session mechanism for each and every process in execution queue.
think it helps..
for more ask me on my official website www.skywebtechno.com