Sign in to follow this  

Threading with Mac OS X

This topic is 3574 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm currently learning C++ on a latest model iMac and I'm having some issues with threading. I'm working on a class project that we just recently threaded. The problem is that while it executes fine on the windows machines at school, when I run it on this Mac, it seems that events are not being caught. The animation thread is fine but the event thread apparently isn't being run. We're using the SDL threading library. Let me know if you need more info, thanks for any advice.

Share this post


Link to post
Share on other sites
Is this your own event thread, or is it SDL's optional event thread? I have heard of problems with the latter, but I can't recal specifics.

If it is your own thread, be aware that you must serialise all calls to the SDL API - most likely by restricting them to a single thread. This includes all drawing and event handling code.

Share this post


Link to post
Share on other sites
Quote:
Original post by Aztral
It is my own event thread.. and thanks for the quick response. Frankly, though, I'm not real sure what you mean.
What he means is that you need to put all your SDL calls in the first thread, down to the fact that SDL uses OS libraries whcih may not be thread safe.
Quote:
Would posting the thread code make a difference?


Go ahead, it might help you. Also, I'd like to see what threaded code in SDL looks like.

Share this post


Link to post
Share on other sites

This topic is 3574 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this