From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,3d761f6edbb67618,start X-Google-Attributes: gidfee84,public From: amoss@bagel.cs.huji.ac.il (Amos Shapira) Subject: Writing device drivers - sleep () won't wakeup Date: 1995/08/14 Message-ID: #1/1 X-Deja-AN: 108139359 distribution: world organization: Inst. of Comp. Sci., Hebrew University, Jerusalem, Israel newsgroups: comp.unix.osf.osf1 Hello, The following is under OSF/1 version 3.2, as well as earlier versions I'm writing a simple device driver which talks over two half-duplex propriety parallel cards. One of my problems is that the read() interface, if called while the input queue (filled by the interrupt handler) is empty, will block indefinatly inside a sleep() even though the interrupt handler calls wakeup() on the same address (if the queue is not empty then the read() interface returns immidietly and avoids the sleep() altogether). If the sleep() is called with a PCATCH flag, as the manual suggests in order to keep the process interruptible, then sending an INT signal (e.g. with ^C) will cause the system to hang. ^Z (SIGSUSP?) seems to work. If the sleep() is called without a PCATCH then (as expected?) the process is completly uninterruptible. So far I circumvented the problem by adding a select() interface and probing with select() before calling read(), but this is not the way to go. Any suggestions would be greatly appreciated. Cheers, --Amos -- --Amos Shapira | "Of course Australia was marked for 133 Shlomo Ben-Yosef st. | glory, for its people had been chosen Jerusalem 93 805 | by the finest judges in England." ISRAEL amoss@cs.huji.ac.il | -- Anonymous