Thursday, July 27, 2006

The Joys Of Threading

One of the wonderful things about Cocoa is that it performs so much of the heavy lifting for so many mundane tasks. This is great if you can do everything you want to from within the confines of Cocoa. Unfortunately, this is not always possible. Continuing on my Objective-C++ vector, I want to remind you that if you have C++ code that is doing anything interesting, spawning threads for example, you may need to do some of the heavy lifting yourself. As it turned out, I needed a NSRunLoop to exist in one of my C++ spawned threads. I only discovered this through some helpful hints on Apple Developer Mailing Lists. Although in my case it turned out to be a relatively easy fix (creating a NSRunLoop at the beginning of my C++ spawned thread), it's a good thing to keep in mind that when mixing languages, not all constructs are created equal.

2 Comments:

Anonymous Anonymous said...

This comment has been removed by a blog administrator.

5:16 PM  
Anonymous Anonymous said...

This comment has been removed by a blog administrator.

4:56 PM  

Post a Comment

<< Home