Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Writing device drivers - sleep () won't wakeup
@ 1995-08-14  4:00 Amos Shapira
  0 siblings, 0 replies; only message in thread
From: Amos Shapira @ 1995-08-14  4:00 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-08-14  4:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-08-14  4:00 Writing device drivers - sleep () won't wakeup Amos Shapira

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox