Re: Multiprocessor support: OpenMP problem in Core Audio thread
Re: Multiprocessor support: OpenMP problem in Core Audio thread
- Subject: Re: Multiprocessor support: OpenMP problem in Core Audio thread
- From: Jeff Moore <email@hidden>
- Date: Tue, 05 May 2009 14:52:45 -0700
The thread context on which IO happens in Mac OS X is a time
constraint thread. This is very different from a normal thread
context. Among other things, you have to avoid allocating memory or
doing any other operation that can block. My guess would be that
OpenMP has some baseline incompatibility when running in this context.
On May 5, 2009, at 2:31 PM, Dan wrote:
I was working on adding multiprocessor support to a piece of audio
software, by using OpenMP <http://www.openmp.org>. I can compile and
run OpenMP-enabled code fine - but *not* if the parallelised code is
in the Core Audio callback. If you add something like this, for
example:
#pragma omp parallel for
for(i=0; i<4; ++i){ // the iterations could occur on different cores
printf("%i\n", i);
}
...it will work fine in many cases, but will crash the app if in the
callback. The crash always looks something like this:
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000028
Thread 13 Crashed:
0 libgomp.1.dylib 0x000129cc
gomp_resolve_num_threads + 76 (libgomp.h:380)
1 <<00000000>> 0xf070db60 0 + -261039264
2 libgomp.1.dylib 0x00012b34 GOMP_parallel_start +
48 (parallel.c:107)
So my question is: is there something about the way Core Audio works
that conflicts with what OpenMP does (namely, dynamically create
threads and distribute them across processors)? Is there any way you
can think of, that might allow the two to play nicely together?
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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