Date: Fri, 24 Dec 2004 04:52:25 -0800 (PST) From: "Kamal R. Prasad" <kamalpr@yahoo.com> To: Jan Engelhardt <jengelh@linux01.gwdg.de> Cc: freebsd-hackers@freebsd.org Subject: Re: Kernel crash w/o reason Message-ID: <20041224125226.79738.qmail@web52701.mail.yahoo.com> In-Reply-To: <Pine.LNX.4.61.0412241311530.19395@yvahk01.tjqt.qr>
next in thread | previous in thread | raw e-mail | index | archive | help
--- Jan Engelhardt <jengelh@linux01.gwdg.de> wrote: > >> What should I use instead? A semaphore? > > >You shouldn't have unrelated kernel threads waiting > for a user > >process at all, so this sounds like a design > problem, regardless > >of which mutual exclusion primitive you use. (Bear > in mind that I > >haven't actually looked into what you're trying to > do.) In any > >case, you can always use mutexes to implement > whatever other > >synchronization mechanism you need. > > I wanted that the device can only be opened once, > and holding a mutex while it > is open seemed like a simple idea. (Since > mtx_trylock() will then fail -- easy > to implement.) An even more simpler idea would be to set a flag in the softc data structure on initialization, so as to avoid initializing again. regards -kamal > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org" > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041224125226.79738.qmail>