image
image

Go Back   macosx.com > Design, Media, Programming & Scripting > Software Programming & Web Scripting

Reply
 
LinkBack Thread Tools
  #1  
Old November 1st, 2005, 04:48 AM
Registered User
 
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
CharlyM is on a distinguished road
thread-safe libraries

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
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump


All times are GMT -5. The time now is 05:29 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC1
Copyright 2000-2010 DigitalCrowd, Inc.