[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BOUNCE rtl@rtlinux.org: Approval required: (fwd)



>From owner-rtl Tue Jul 31 19:42:40 2001
Received: from robin.mail.pas.earthlink.net (robin.mail.pas.earthlink.net [207.217.120.65])
	by hq.fsmlabs.com (8.11.2/8.11.2) with ESMTP id f711gP703142
	for <rtl@rtlinux.org>; Tue, 31 Jul 2001 19:42:40 -0600
Received: from earthlink.net (cpe-66-1-168-58.az.sprintbbd.net [66.1.168.58])
	by robin.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id SAA29085;
	Tue, 31 Jul 2001 18:41:59 -0700 (PDT)
Sender: mgermain@earthlink.net
Message-ID: <3B675DF6.F98FC2E@earthlink.net>
Date: Tue, 31 Jul 2001 18:40:06 -0700
From: Marvin Germain <megermain@earthlink.net>
Organization: Zygo Corporation
X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14-5.0 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: rtl@rtlinux.org, sseeger@stellartec.com
Subject: Re: keyboard freeze with one percent CPU load
References: <3B65EAA0.19963CD2@earthlink.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello again.

I found a *temporary* workaround to my problem. I created a periodic thread
as follows:

void *periodic_entry_point(void *p) {
         while(1) {
                  rtl_schedule();
                  pthread_wait_np();
          }
}

A period of 500 nano-seconds was too short and locked up my machine.  I
changed this to 50 milli-seconds, and the keyboard remains responsive even
with interrupts coming once every 850 micro-seconds.  Putting the
rtl_schedule() command inside the ISR or in the thread woken up by the ISR
did NOT work.  I am a little uncomfortable with this solution, since it
seems that the CPU is probably sitting idle until the rtl_schedule()
command occurs, therefore wasting many CPU cycles.  Can anyone offer a
better solution? Thanks.

Marvin

Marvin Germain wrote:

> Hello, all.
> My mouse and keyboard freeze when I call pthread_wakeup_np() from within
> a hard interrupt service routine.  I am using RTLinux 3.0 with kernel
> 2.2.18 on a 1.5 GHz P4.  My project uses two RTLinux modules: The first
> services hardware interrupts and transfers data from a DAQ board into an
> mbuff.  The first module then wakes up a thread containied in a second
> module which performs computations on the data.  Here is the basic
> format:
>
> **************
> First module:     *
> **************
>
> extern pthread_t myThread;
>
> unsigned int my_isr(unsigned int irq, struct pt_regs *regs) {
>    /* perform hardware-related things here */
>    rtl_hard_enable_irq(irq);
>    pthread_wakeup_np(myThread);
> }
>
> ***************
> Second module:  *
> ***************
>
> pthread_t myThread;
>
> void *myEntryPoint(void *p) {
>    while(1) {
>       pthread_suspend_np(myThread);
>       /* perform calculations here */
>    }
> }
>
> When the interrupt rate is once every five milli-seconds, the mouse and
> keyboard freeze within two to three seconds.   If I slow down the
> hardware so that the interrupts come only once every six milli-seconds,
> everything seems fine.  I timed the execution of the ISR at 50
> micro-seconds.  So the CPU loading is only one percent.  The freezes
> occur even if I comment out everything in the while-loop except for the
> pthread_suspend_np().  The freezes do NOT occur if I comment out the
> pthread_wakeup_np() from the ISR.  Any ideas?
>
> Marvin
>

--
-
*********************************************
*         Dr. Marvin E. Germain             *
*         Zygo Corporation - Tucson AZ      *
*         megermain@earthlink.net           *
*********************************************


----- End of forwarded message from owner-rtl@fsmlabs.com -----