FROM : Stefan Johansson
DATE : Mon Dec 09 23:54:01 2002
Thanks for the help all. I suspected that CFSTR was at fault somehow
(judging by the back trace).
Cheers,
Stefan
On 2002-12-09 22.17, "Ali Ozer" <<email_removed>> wrote:
>>> Maybe I should share the pointer itself between threads and not the
>>> bundle,
>>> maybe the CFBundleGetFunctionPointerForName call isn't thread-safe?
>>
>> One problem may be that CFStringMakeConstantString isn't (wasn't?)
>> thread safe. This is used by CFSTR(). You could try to serialize all
>> of your CFSTR() calls in one place (like before all of your threads
>> start up), or use MACOSX_DEPLOYMENT_TARGET=10.2 in the environment
>> when building your code to use a thread-safe CFString creation
>> mechanism.
>
> Actually I believe that only the calls to CFSTR() while it is
> initializing its table are not thread-safe; doing a CFSTR() once in the
> main thread before you start up your threads would workaround this.
> CFSTR() is thread-safe beyond that. And as Matt says it should be
> completely thread safe with MACOSX_DEPLOYMENT_TARGET=10.2, which
> enables the "constant CFSTR" option.
>
> The backtrace in your email could also be the result of a CFSTR() being
> deallocated. Running against a debuggable CoreFoundation might help
> catch this.
>
> Ali
>
>
>
DATE : Mon Dec 09 23:54:01 2002
Thanks for the help all. I suspected that CFSTR was at fault somehow
(judging by the back trace).
Cheers,
Stefan
On 2002-12-09 22.17, "Ali Ozer" <<email_removed>> wrote:
>>> Maybe I should share the pointer itself between threads and not the
>>> bundle,
>>> maybe the CFBundleGetFunctionPointerForName call isn't thread-safe?
>>
>> One problem may be that CFStringMakeConstantString isn't (wasn't?)
>> thread safe. This is used by CFSTR(). You could try to serialize all
>> of your CFSTR() calls in one place (like before all of your threads
>> start up), or use MACOSX_DEPLOYMENT_TARGET=10.2 in the environment
>> when building your code to use a thread-safe CFString creation
>> mechanism.
>
> Actually I believe that only the calls to CFSTR() while it is
> initializing its table are not thread-safe; doing a CFSTR() once in the
> main thread before you start up your threads would workaround this.
> CFSTR() is thread-safe beyond that. And as Matt says it should be
> completely thread safe with MACOSX_DEPLOYMENT_TARGET=10.2, which
> enables the "constant CFSTR" option.
>
> The backtrace in your email could also be the result of a CFSTR() being
> deallocated. Running against a debuggable CoreFoundation might help
> catch this.
>
> Ali
>
>
>
| Related mails | Author | Date |
|---|---|---|
| Stefan Johansson | Dec 9, 06:13 | |
| Matt Watson | Dec 9, 09:04 | |
| Ali Ozer | Dec 9, 13:17 | |
| Stefan Johansson | Dec 9, 23:54 |






Cocoa mail archive

