c# - CPU Utilisation -


i have small program attempts find largest prime factor of large number. have written program in c#. brute force , take quite sometime complete. deliberate i'm trying understand how cpu utilised.

how can utilise cpu. @ moment ever uses 25% while 68% of time cpu idle: enter image description here

why program not use available cpu cycles?

update:

the cpu history 4 cores looks thisenter image description here

why none of these right @ top?

if computer has multicore architecture (which likely), way you'll high amount of usage if make use of multiple threads.

for example, if computer quad-core, you'll use 25% of cpu if use single thread.

by using multiple threads (either via explicit multithreading code or via parallel.for) you'll close 100%, not - there overheads keep programs achieving full usage. nature of algorithm (i.e. how parallelisable is) makes big difference. ray tracing embarrassingly parallel , overheads miminal.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -