That is not what you told us, but perhaps there is a misunderstanding. In
your first message you said:
> My machine has exactly 8 cpu's and I found that the runtime does not
decrease linearly when the number of go routines increases.
Are you saying that the runtime does not decrease linearly when increasing
the number of goroutines from 1 to 8 (the number of cores on your system)?
Or when increasing the number of goroutines beyond 8?
Also, your original code did `for i := 1; i < Mcpu; i++ {` which only
creates 7, not 8, goroutines. Is that intentional? It seems wrong given the
discussion to this point. Which raises additional questions about your
premise.
On Mon, Feb 1, 2021 at 8:04 PM 颜文泽 <[email protected]> wrote:
> But the number of my routines is smaller than the number of cpu
>
> 在2021年2月2日星期二 UTC+8 上午11:17:55<[email protected]> 写道:
>
>> If you look at the “disrupter pattern” you’ll see what I mean. If the
>> tasks are cpu bound - by having more threads/routines than cpus you cause
>> inefficiencies (scheduling overhead, cache locality / invalidation, lock
>> contention).
>>
>
--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD8xXYhFkiD3zOWuwwqiqW1xMcmt7WBLUkzkWznZeUPrWA%40mail.gmail.com.