On Friday, March 12, 2004, at 08:41 PM, Ramble Leon wrote: Thanks, does it mean any syscall will hold a funnel when it enter kernel? If no thread_funnel_switch inside, a syscall cannot be called by two or more threads running on differenct processors at same time, is it right? System calls will take a funnel when entering the kernel. That is required. You are correct that holding a funnel on one processor will inhibit a thread from taking that funnel on a different processor. If there were just one funnel, this would mean that only one process at a time could be actively executing in the kernel. However: - there are two funnels, one for network operations, and one for other "BSD" kernel operations; and - the funnels only affect the BSD component of the kernel; IOKit and Mach have other synchronisation mechanisms that are "finer-grained" The 'funnel' scheme is designed as an interim step in making the Darwin kernel "MP-efficient". Since the BSD underpinnings were not MP-safe, much less efficient, we needed something akin to a Giant Lock to assure that MP operations would be safe. The two-funnel scheme is a pretty effective compromise that got things running, and avoided a long dark period while we (now, they :-}) developed a higher-performance implementation. Hope that helps. Regards, Justin --- Quinn <eskimo1@apple.com> wrote: At 2:04 -0800 12/3/04, Ramble Leon wrote: Hi, I'm confused by funnel in darwin, I was reading some source code of nfs, there is no thread_funnel_set can be found in some vfs syscall, but there are many thread_funnel_switch inside nfs implement, when did the system call get the kernel_funnel? Funnels are acquired as part of system call entry. Check out the sy_funnel field of the sysent structure. S+E -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Technical Support * Networking, Communications, Hardware _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored. __________________________________ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored. _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.