Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: performance issues



On Wed, 30 Mar 2005 14:05:05 -0500, Gwynne <email@hidden> wrote:
> On Mar 30, 2005, at 1:55 PM, George Warner wrote:
>> I recommend MP over POSIX for all but the most advanced thread
>> programmers.
>> It doesn't have POSIX's steep learning curve and is very powerful. But
>> if
>> you don't need all it's bells and whistles then the simplest POSIX
>> code can
>> certainly perform faster.
>
> I disagree that pthreads has such a steep learning curve. IMO it's no
> more complicated than MP conceptually, and it's certainly simpler in
> API. I've been very satisfied with pthreads (and NSThread when using
> Cocoa, which is a VERY thin layer atop pthread_t); MP would represent
> an unnecessary learning curve.

If we were just discussing pthreads I would agree but when you include the
synchronization primitives I think you'll come up with a different answer.
The MP API's "just work" exactly as expected because they check all the
edges for you. In POSIX code you have to do a lot more work to get
everything right. To me there's nothing more annoying than having a mutex
unblock because of a completely unrelated signal on a different thread. To
me this is just wrong and I shouldn't have to write code to deal with this
possibility. Other opinions differ. ;-)

I'll also agree that "conceptually" they're virtually identical. However in
implementation the pthread API's seem to have a lot more gotcha's.

POSIX has both the advantage and disadvantage of being cross platform. The
advantage being that your code is more portable and the disadvantage being
that implementations are different on different platforms (and you have to
know those differences).

I can safely say that the MP API's are the same on all the platform's that
it runs on. (one) ;-)

-- 
Enjoy,
George Warner,
Schizophrenic Optimization Scientist
Apple Developer Technical Support (DTS)


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.