Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 23 Aug 2002 08:11:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 23 Aug 2002 08:11:31 -0400 Received: from chaos.analogic.com ([204.178.40.224]:34689 "EHLO chaos.analogic.com") by vger.kernel.org with ESMTP id ; Fri, 23 Aug 2002 08:11:30 -0400 Date: Fri, 23 Aug 2002 08:17:07 -0400 (EDT) From: "Richard B. Johnson" Reply-To: root@chaos.analogic.com To: sanket rathi cc: linux-kernel@vger.kernel.org Subject: Re: interrupt handler In-Reply-To: <20020823115821.26511.qmail@linuxmail.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1222 Lines: 36 On Fri, 23 Aug 2002, sanket rathi wrote: > hi, > Can i use spin lock in the interrupt handler for a singlre processor > machine. because books says u can not use locks but spin lock is some > thing diffrent > > thanks in advance > > --Sanket > --------- Interrupts default to OFF within an interrupt handler. Given this, why would you use a spin-lock within the ISR on a single-processor machine? To directly answer your question, YES, you can use a spin-lock within an ISR even though it won't do anything except add code on a single processor machine. On multiple CPU machines, you can use the form of spin-lock that does not save/restore interrupts within the ISR, and use the save/restore versions, with the same lock variable, outside the ISR. Cheers, Dick Johnson Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips). The US military has given us many words, FUBAR, SNAFU, now ENRON. Yes, top management were graduates of West Point and Annapolis. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/