On Fri, Jun 17, 2016 at 2:23 PM, Dmitry Orlov wrote:
If I understand it correctly, go scheduler instruments code with additional
yield points not related to I/O. That can help fairness too.
It will sometimes pre-empt on function calls, but this can get a bit
hairy since you can't always be sure what function calls will be
inlined. This has caused problems for me before where I was adding
lots of CPU intensive goroutines to the schedulers queue, and it was
context switching so much that it never finished any of them (which I
suppose shouldn't have suprised me, but it would be an easy mistake
for a new user who may expect CPU intensive work not to yield to

For example, see this (not-very-scientific) analysis of some bcrypt
benchmarks (TL;DR they get faster if we make inlining a lot more
aggressive) which has many thousands of function calls in a loop in
the blowfish block cipher:


Sam Whited
pub 4096R/54083AE104EA7AD3

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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 4 | next ›
Discussion Overview
groupgolang-nuts @
postedJun 16, '16 at 6:45p
activeJun 17, '16 at 7:47p



site design / logo © 2022 Grokbase