Date: Sun, 05 Jul 1998 22:02:55 +0200 From: Stefan Eggers <seggers@semyam.dinoco.de> To: zhihuizhang <bf20761@binghamton.edu> Cc: hackers@FreeBSD.ORG, seggers@semyam.dinoco.de Subject: Re: Lock mechanism questions Message-ID: <199807052002.WAA06547@semyam.dinoco.de> In-Reply-To: Your message of "Sat, 04 Jul 1998 16:20:57 EDT." <Pine.SOL.L3.93.980704160548.19518B-100000@bingsun1>
next in thread | previous in thread | raw e-mail | index | archive | help
> By the way, I know spin lock is not suitable for interrupt routines that > access the same data structures. Can anyone give me a reason for this? Isn't that because of the problems you have when a higher priority interrupt occurs while serving a lower priority interrupt and both want to access the data structures? Then the lower priority one would have to get at least to the place where it frees the lock to allow the higher priority one to continue. But how does it achieve this? The higher priority interrupt gets serviced first. Deadlock. The same for an interrupt and a normal kernel function which both try to access the same spin lock protected data structure. Then a similar situation arises. For processes it works as the waiting process eventually has to give up the CPU. Then the process holding the lock can work further toward releasing it. That's how I understand this problem with what I know as spin lock. I might be wrong of course. Stefan. -- Stefan Eggers Lu4 yao2 zhi1 ma3 li4, Max-Slevogt-Str. 1 ri4 jiu3 jian4 ren2 xin1. 51109 Koeln Federal Republic of Germany To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807052002.WAA06547>