[Openal] AL error states and threads
Brian Meidell Andersen
brian at gameequation.com
Mon Nov 26 11:26:09 PST 2007
Thanks for the answer!
I've already solved the problem that I was having, but wouldn't it be a
good idea to change this in the spec and implementation for the future?
Reasons:
1) It's what OpenGL does
2) It would make it possible to follow the recommended alGetError()...
alWhateverCall()... alGetError() flow, without the need to mutex every
single OpenAL call set
3) I have a hard time thinking of any drawbacks, beyond the fact that
someone needs to implement the change.
The fact that the error state is not stored per thread right now, makes
the fact that OpenAL is thread safe an almost moot point if you want to
implement error checking in your program, since you need to litter your
code with mutexes around every alGetError/alWhateverCall/alGetError set
anyway.
Just a thought.
/Brian
Daniel PEACOCK wrote:
>
> Hi Brian,
>
> >> If I have two threads, A and B, does a bad alSomething
> >> call on thread A return an error for alGetError in thread B?
>
> Unfortunately the answer is "yes" because the error is stored
> per-Context. This is one of the downsides to have function calls that
> don't return error codes.
>
> Dan
> Creative Labs, Inc.
>
> ourceID:NT000522FA
More information about the Openal
mailing list