[Mono-dev] GC stop world stopping audio threads

Zoltan Varga vargaz at gmail.com
Wed Jun 4 09:04:47 EDT 2008


AFAIK, the GC only stops threads which are registered with it. This
can happen in
the following ways:
- threads started by the runtime are registered automatically
- threads registered using mono_thread_attach ().
- on unix, if an application includes gc.h, the header file will
redefine pthread_create
 () etc. with gc specific versions which register threads
- on windows, the gc registers all threads automatically.

Under what OS you experience this ? BTW, the problem with not
registering threads
with the GC is that threads suspended by the GC could hold locks etc.,
so if another
thread tries to use these locks (like the malloc lock), it will be
suspended anyway.
Also, if one of these unsuspended threads tries to register itself or enter the
runtime while the word is suspended, various complex situations could occur.


On Wed, Jun 4, 2008 at 2:41 PM, Joachim Ante <joe at unity3d.com> wrote:
> Hi,
> When the GC is under stress because a lot of managed allocations
> happen we get sound stuttering.
> It seems very likely that the GC is doing that when it calls Stop
> World on all other threads.
> Is there any way to make the Garbage collector only stop threads
> which are registered using mono_thread_attach?
> Best regards,
> Joachim Ante
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

More information about the Mono-devel-list mailing list