Why would a select statement take up most of the execution time? 

Is there another way to implement a non blocking channel?

On Monday, November 14, 2016 at 6:01:24 PM UTC+5:30, Michael Jones wrote:
>
> This is funny in the sense that my programs are great at stressing the CPU 
> even though I don’t want to! :-) 
>
>  
>
> I looked at your hogcpu() function and saw an issue: you busy loop repeats 
> a select statement and a square root. Almost any simple implementation of 
> this will spend all of its time in the select. Put a loop around that 
> math.Sqrt() so that the “hog” routine is doing mostly sqrt() and not mostly 
> select. DO something similar for the hogio and other hog functions.
>
>  
>
> *From: *<golan...@googlegroups.com <javascript:>> on behalf of <
> vyasgir...@gmail.com <javascript:>>
> *Date: *Monday, November 14, 2016 at 4:06 AM
> *To: *golang-nuts <golan...@googlegroups.com <javascript:>>
> *Subject: *[go-nuts] Stressing the system using
>
>  
>
> I have been working on this applications to stress the cpu, io and the 
> hard drive.
>
>  
>
> https://github.com/vyasgiridhar/gstress
>
>  
>
> Kind of like stress <http://people.seas.harvard.edu/~apw/stress/>. But i 
> am unable to achieve high load. This might be due to the scheduling of 
> goroutines.
>
> Is there a work around for this?
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts...@googlegroups.com <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to