Funnel (concurrent computing)

In Computer science, a funnel is a synchronization primitive used in kernel development to protect system resources. First used on Digital UNIX as a way to "funnel" device driver execution onto a single processor, funnels are now used in the Mac OS X kernel to serialize access to the BSD portion of XNU. [1]

A funnel is a mutual exclusion (mutex) mechanism that prevents more than one thread from accessing certain kernel resources at the same time. Each thread acquires a funnel when it enters a synchronized portion of the kernel, and releases it when it leaves. If a thread blocks (sleeps) while holding a funnel, the kernel forces the thread to automatically drop the funnel, thereby allowing other threads to enter the synchronized portion of the kernel.

Because a funnel is automatically dropped when a thread blocks, care must be taken to ensure that synchronized resources are acquired again after any blocking operation. Specifically, acquiring a funnel can be a blocking operation, so if multiple funnels are needed, they must be acquired at once. This limits the utility of funnels because it increases the granularity of locking when multiple funnels need to be held at once.

In Mac OS X

There is only one funnel in OS X 10.4 and higher. Prior to version 10.4, there are two funnels: one protects network resources, and the other protects other BSD kernel resources. A thread was only allowed to hold one funnel at a time, and holding both would cause a kernel panic. As a result of these limitations and the lack of granularity, funnels are being phased out of Mac OS X. For example, the networking funnel has been replaced by finer-grained locking mechanisms.

See also

Notes

For notes referring to sources, see bibliography below.

  1. ^ Singh 07, pp. 1223-1229

References

  • Singh, Amit (2007). Mac OS X Internals, A Systems Approach. Boston, Massachusetts: Addison-Wesley. ISBN 978-0-321-27854-8.

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.