Kernel sleep priorities

Andrew Klossner andrew at frip.gwd.tek.com
Tue May 10 15:41:15 AEST 1988


	"It is possible to sleep interruptably, yet keep state, if you
	are willing either to notice stale states and clean up later,
	or to use `setjmp' to catch signals through kernel sleeps.
	Alas, there is only a single place in which the setjmp data is
	(are?) stored, `u.u_qsave' in 4.3BSD, and it is usually in use
	by the time you reach a driver."

That's not a problem: save u.u_qsave in an "auto" structure, use it for
"setjmp", then restore it.

(BTW, under system V release 3, you can tell sleep to return to you on
interrupt rather than to the outstanding setjmp, bypassing the need to
save/restore u.u_qsave.  OR PCATCH into the second parameter and sleep
will return 1 if the sleep was interrupted, 0 if it wasn't.)

  -=- Andrew Klossner   (decvax!tektronix!tekecs!andrew)       [UUCP]
                        (andrew%tekecs.tek.com at relay.cs.net)   [ARPA]



More information about the Comp.unix.wizards mailing list