thread-safe libraries

CharlyM

Registered
I'm developing an application using mutilthreading with the threads communicating via distributed objects. The idea is that the main thread sends the worker thread a message like [server doWork] and the worker replies to this message after finishing the work with a [client done] message. When I declare the messages like this:

- (void)doWork;
- (void)done;

it works fine, but the threads are not running in parallel. As soon as the doWork message is send by the main threads it sleeps until it get's the answer from the client thread. So I changed the declaration to:

- (oneway void)doWork;
- (oneway void)done;

now when I run the application it hangs. I used NSZombieEnabled to find out if I might be using objects that already have been deallocated but the program is clean. I also used the libgmalloc to try and find out if I am violating the heap, but it didn't help eather.

Is there something else I have to take into account when creating multithreaded applications. Do I need to use different libraries which are thread-safe? Do I have to change a setting in xcode so that the make process is aware of the multithreaded application?

Thanks
Charly
 
Back
Top