Date: Wed, 13 Sep 2000 11:23:35 -0400 (EDT) From: Robert Watson <rwatson@FreeBSD.org> To: freebsd-arch@FreeBSD.org Subject: thread related papers, et al. Message-ID: <Pine.NEB.3.96L.1000913111456.31488G-100000@fledge.watson.org>
next in thread | raw e-mail | index | archive | help
Some concern has been expressed, and I admit to expressing this concern myself, that we may be rushing headlong into threading the kernel without thinking through it very much, and an eager desire to plop mutexes wherever we can put them. So far, not problems, but it's a problem worth keeping in mind, especially since there seems to be a lot of confusion about the types of synchronization primitives and how to use them correctly (and efficiently). I thought I'd post a couple of paper references that might be interesting for people to look at if this is a topic that interests them. I think it would also be very helpful if, once the basic framework for SMPng is finished (interrupt threads, synchronization primitives, etc), we could assemble a guide for threaded kernel programming, including a combination of suggestions, guidelines, and directives for the correct approaches to take in the kernel. A number of existing kernel programmers may not have direct or extensive experience with kernel programming, and helping to short-cut the learning curve would probably be much appreciated, both by them and by the consumers of FreeBSD :-). Birrell89: Andrew Birrell. An introduction to programming with threads. DEC technical report TR-35, DEC/SRC, January, 1989. Hauser93: Carl Hauser, Christian Jacobi, Marvin Theimer, Brent Welch, Mark Weiser. Using threads in interactive systems: A case study. ACM Symp. on Operating Systems Principles (SOSP-14), December 1993. Savage97: Stefan Savage, Michael Burrows, Greg Nelson, Patrick Sobalvarro, Thomas Anderson. Eraser: A Dynamic Data Race Detector for Multi-Threaded Programs. ACM Symp. on Operating Systems Principles (SOSP-16), October 1997. The last is pretty researchy, and as such is probably not something you want to consider a directive on how to program, but it's worth learning from their experiences, and understanding both the problems they need to deal with, and solutions they have in mind (as well as the limitations of that solution). Darren Reed also recently pointed me at a Solaris kernel programmers glossary online that I found very useful to read, to see how others have done this. It's probably already been posted, but the URL is: http://docs.sun.com:80/ab2/coll.40.6/REFMAN9F/@Ab2TocView?Ab2Lang=C&Ab2Enc=iso-8859-1 One priority Darren has expressed is getting the lock manager working properly with SMPng, as mutexes don't provide the semantics he needs in terms of read vs. write locks; this seems like a reasonable viewpoint, and possibly it's just a question of cleaning up the lock manager a little, and wrapping locks in mutexes (to a first approximation). That said, the Solaris lock calls seem a lot cleaner, so maybe we should adopt something like their APIs and semantics, which would also give Solaris kernel module programmers a starting point if they want to port third party modules to FreeBSD :-). Robert N M Watson robert@fledge.watson.org http://www.watson.org/~robert/ PGP key fingerprint: AF B5 5F FF A6 4A 79 37 ED 5F 55 E9 58 04 6A B1 TIS Labs at Network Associates, Safeport Network Services To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1000913111456.31488G-100000>