java - Situations for multithreading -
java - Situations for multithreading -
are there guidelines know whether particular programme benefit multithreading?
in single threads, cpu utilization low, higher in cases if unrelated parts of programme made separate threads. maybe when 1 thread waiting i/o, other threads can utilize cpu. things out in programme see whether benefit multithreading?
usually, multithreading when can decompose task in several independent subtask , have several processors perform task (optimization), or if need maintain scheme "interactive" (even if blocking task, reading network, beingness performed, other threads can maintain attenging user requests, example).
and reason simulate paralelism (even if haven't got many processors threads) execute several "tasks" simultaneously (even if not real optimization achieved). tipically operating systems do, run several programs in paralell, if have give them little portions of time execute alternatively.
java multithreading
Comments
Post a Comment