Re: ObjC Garbage Collector and MIDI Thread
Re: ObjC Garbage Collector and MIDI Thread
- Subject: Re: ObjC Garbage Collector and MIDI Thread
- From: Camille Troillard <email@hidden>
- Date: Fri, 16 Jul 2010 12:36:47 +0200
Thank you Jeff. Your second comment is exactly the kind of
information I was searching for.
I have searched a little further and found that making simple function
calls (or objective-c messaging) without waking up the GC was in fast
possible. That means my MIDI thread now runs without the garbage
collection enabled.
I guess I have the best of both worlds.
On Thu, Jul 15, 2010 at 6:48 PM, Jeff Moore <email@hidden> wrote:
> Garbage Collectors have to block threads in order to collect on them. These blocks are typically short, but there are no guarantees on an upper bound for how long they may delay the thread in question. This is completely anathema to real time operations. The best possible case is that you will have bad timing. The worst case is that you will lose data as deadlines get missed.
>
> Not to mention the fact that your code does not own the threads in question. They can and will die and respawn at the behest of the MIDI system. So, you always run the risk of having a new thread come along and call one of your callbacks in a non-collected thread.
>
> This is why we don't recommend using GC or anything that touches GC'd memory on the various real time contexts.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden