FROM : Charles Steinman
DATE : Wed Feb 20 21:09:26 2008
--- Trygve Inda <<email_removed>> wrote:
> I am moving a rendering engine of sorts from Carbon
> to Cocoa. It is heavily
> based on MPTasks and uses Carbon events to send
> messages back to the main
> event handler (on the main thread) to handle things
> that are not thread
> safe.
>
> In Carbon, I would Post an event and call:
>
> err = MPWaitOnQueue (pTaskInfo->mSignalQueueID,
> (void **)
> &pTaskInfo->mQueueMessage, NULL, NULL,
> kDurationForever);
> if (pTaskInfo->mQueueMessage == kMyTaskSignalAbort)
> pTaskInfo->mAbort = true;
>
> When the main thread would be done with the task, it
> would call:
>
> MPNotifyQueue (pTaskInfo->mSignalQueueID, (void *)
> kMyTaskSignalContinue,
> NULL, NULL);
>
>
> Is there a good online reference to the Cocoa
> equivalent of this?
If you can require 10.5, you might look at
NSOperation/NSOperationQueue. I haven't used the
Carbon Multiprocessing Services, but it sounds like
that should be roughly equivalent.
>
> How much of Cocoa is thread safe?
http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/chapter_950_section_2.html
Cheers,
Chuck
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
DATE : Wed Feb 20 21:09:26 2008
--- Trygve Inda <<email_removed>> wrote:
> I am moving a rendering engine of sorts from Carbon
> to Cocoa. It is heavily
> based on MPTasks and uses Carbon events to send
> messages back to the main
> event handler (on the main thread) to handle things
> that are not thread
> safe.
>
> In Carbon, I would Post an event and call:
>
> err = MPWaitOnQueue (pTaskInfo->mSignalQueueID,
> (void **)
> &pTaskInfo->mQueueMessage, NULL, NULL,
> kDurationForever);
> if (pTaskInfo->mQueueMessage == kMyTaskSignalAbort)
> pTaskInfo->mAbort = true;
>
> When the main thread would be done with the task, it
> would call:
>
> MPNotifyQueue (pTaskInfo->mSignalQueueID, (void *)
> kMyTaskSignalContinue,
> NULL, NULL);
>
>
> Is there a good online reference to the Cocoa
> equivalent of this?
If you can require 10.5, you might look at
NSOperation/NSOperationQueue. I haven't used the
Carbon Multiprocessing Services, but it sounds like
that should be roughly equivalent.
>
> How much of Cocoa is thread safe?
http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/chapter_950_section_2.html
Cheers,
Chuck
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
| Related mails | Author | Date |
|---|---|---|
| Trygve Inda | Feb 20, 20:03 | |
| j o a r | Feb 20, 20:22 | |
| Charles Steinman | Feb 20, 21:09 | |
| Adam P Jenkins | Feb 20, 22:32 | |
| Trygve Inda | Feb 21, 16:10 | |
| Trygve Inda | Feb 21, 16:14 | |
| j o a r | Feb 21, 16:20 | |
| Scott Ribe | Feb 22, 17:33 | |
| Trygve Inda | Mar 10, 22:05 | |
| Hamish Allan | Mar 10, 22:41 | |
| Ken Thomases | Mar 11, 06:40 |






Cocoa mail archive

