Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: pthread code I may use
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pthread code I may use




On Apr 1, 2008, at 3:54 PM, Theodore H. Smith wrote:

On 1 Apr 2008, at 23:36, Rick Altherr wrote:

Why not use AIO? Then you don't need to handle the thread creation, etc. You would just specify what file descriptor, offset, and length you want read. Then, when you are ready, you can see if the AIO was completed.

Because I heard AIO is sometimes implemented as threads underneath :)

So I might as well write my own thread code, and cut out the overhead.

Also, I want my code to run on Mac MachO, Win32, and Linux, and Mac Carbon too. Not sure how that will work out with AIO.

And finally... I just like learning and doing new things. So getting threads to work is kinda cool to me.

--
http://elfdata.com/plugin/
"String processing, done right"




AIO definitely exists in MacOS X, Linux, and Windows (though the functions change names here). I'm not entirely sure what you mean by Carbon (OS 9 or OS X using Carbon. It is there if the latter.)

It _could_ be written as threads, but that isn't really the point. The system has more knowledge about how many AIO requests are being sent out system-wide. It will ensure that at most a system-wide # of requests will be inflight. That can save overall system performance even if it hurts you program under certain circumstances. Why reinvent the wheel?

--
Rick Altherr
Architecture and Performance Group
email@hidden


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >pthread code I may use (From: "Theodore H. Smith" <email@hidden>)
 >Re: pthread code I may use (From: Rick Altherr <email@hidden>)
 >Re: pthread code I may use (From: "Theodore H. Smith" <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.