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: open fails in daemon



Non-prebound applications run a library/module's init routine the first time a symbol from that library/module is referenced/called. But when an application is correctly pre-bound, all symbol references are "pre-resolved" before the app begins. This greatly reduces the overhead of referencing those symbols, but it means dyld has no "first call" hook to run the initializers. Therefore, all the initializers are all run before main() in a pre-bound application.

If use link against a framework whose init routine has some side effect, that side effect will occur before main() on a pre-bound application and likely much later in a non-prebound application. Some non-prebound applications [or prebound ones with out-of-date dependencies] may get away with calling fork() early on, for instance, since the side effects of the framework init routines has not taken effect yet. But if you update its prebinding it stops working because the side-effect of the init routine occurs before main().

--Jim

On Wednesday, July 23, 2003, at 9:10 AM, Dan Williams wrote:
Can you explain a little further about what you said here? Why is this the case for prebound vs un-prebound applications/frameworks/libraries?

Also, make sure you always compare pre-bound vs.
pre-bound. Often, it's just the difference between pre-bound and not
that can trigger these fork() issues (init routines are all called up
front in pre-bound applications and on first use of a framework
otherwise).

Thanks,
Dan
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: open fails in daemon (From: Dan Williams <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.