Wow! That __is__ worth knowing. Thank
you.
Regards,
----------------------------------------------------------------------
Paul Sanders
AlpineSoft
----- Original Message -----
Sent: Monday, June 21, 2010 11:03 PM
Subject: Re: Question: What is the impact of changing .cpp
AudioUnitEffectsource to .mm
On Jun 21, 2010, at 12:45 AM, Paul Sanders wrote:
OK, thanks very much. It looks like method
resolution is the only time objc_msgSend can block so it is possible to
use objC calls in an IOProc if one takes a bit of care, which is what I wanted
to establish.
No, you can't. At least, you can't in an ObjC app
that is running under GC.
The reason why is that GC will stop a thread, and while in most cases the
stopping is minimal, it is not unbounded. We deliberately do not create GC
contexts on the I/O thread, so doing any operation with the ObjC runtime on that
thread will crash in snow leopard in a GC app. That also includes interacting
with any CF object; many of the CF objects are implemented using ObjC, and due
to the bridging between CF and ObjC, this becomes a problem (so using CF on the
I/O thread as well is not advised).
In a non-GC case, then you have whatever restrictions imposed on you by the
ObjC runtime.
Bill
|