Does GC pause affect non-go threads spawned by CGo?

177 views
Skip to first unread message

Amir DER

unread,
Oct 25, 2021, 11:43:49 AM10/25/21
to golang-nuts
Does GC pause affect non-go threads spawned by CGo?

Robert Engels

unread,
Oct 25, 2021, 1:12:22 PM10/25/21
to Amir DER, golang-nuts
No, unless they call back into Go. 

On Oct 25, 2021, at 10:43 AM, Amir DER <roc...@gmail.com> wrote:

Does GC pause affect non-go threads spawned by CGo?

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/7d165522-f261-4391-9708-eb3ace3fb7a2n%40googlegroups.com.

drc...@google.com

unread,
Oct 27, 2021, 3:31:08 PM10/27/21
to golang-nuts
The pause also tends to not be large.  Except for bugs (which do exist and some of them are hard to fix) the goal on a modern fast processor is under 100 microseconds of a thread "pausing".  There is a period of time where goroutines will make reduced progress as the garbage collector steals either time slices or a processor(s), but the intent is that this be as concurrent (and parallel) as possible.  It's complex -- in some bugs the over-long pause is caused by "bad accounting" where a goroutine simply fails to get credit for the work it does on behalf of garbage collection.
Reply all
Reply to author
Forward
0 new messages