From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32282 invoked by alias); 20 Jun 2006 12:52:38 -0000 Received: (qmail 32272 invoked by uid 22791); 20 Jun 2006 12:52:37 -0000 X-Spam-Check-By: sourceware.org Received: from mail2.pepperl-fuchs.com (HELO alf.pepperl-fuchs.com) (212.21.166.254) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 20 Jun 2006 12:52:35 +0000 Received: from pfde-mx5.EU.P-F.BIZ (pfde-mx5.eu.p-f.biz [172.16.200.5]) by alf.pepperl-fuchs.com (8.12.3/8.12.3/SuSE Linux 0.6) with ESMTP id k5KCqVXx023480 for ; Tue, 20 Jun 2006 14:52:31 +0200 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Tue, 20 Jun 2006 12:52:00 -0000 Message-ID: <651FDF993328694286BDDA6A0A3606B912E14E@pfde-mx5.EU.P-F.BIZ> From: "Goldschmidt Simon" To: X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] why is it wrong to call cyg_semaphore_post() in ISR??? X-SW-Source: 2006-06/txt/msg00177.txt.bz2 Hi, >> Normally, you try not to disable interrupts in RTOS's. You should=20 >> protect your critical regions with mutex's, semaphores etc. >> That might be true if minimal interrupt latency is your main goal. But if y= ou have to get the best performance out of your hardware, disabling interru= pts seems faster to me than using mutexes... > >I remember well that I(we in our company) have used intLock () in=20 >VxWorks to make sure that interrupt doesnt during some critical=20 >sections. Ofcourse we did use semaphores and mutexes to guard against=20 >other threads but as far as I remember i never used semaphores/mutexes to = guard against interrupts. > > lockKey =3D intLock (); > > ... (work with interrupts locked out) > > intUnlock (lockKey); That's how we do it with =B5C/OS. >Seems in eCos we dont need to disable interrupts because interrupts=20 >doesnt perform any kernal calls and we can use DSR to give semaphores=20 >and etcthank you Any idea what the performance loss is by using ISR+DSR instead of ISR only? We are using NIOS-II processor and any context switch avoided makes our sys= tem a lot faster! Thanks, Simon. -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss