peter@cm.deakin.oz.au (Peter Horan) (05/06/91)
I am using SCO Xenix 386 v2.3.2 I have opened pipes for communication between a parent and child, forked the child, closed the unwanted ends of the pipes in the parent and child and selected the O_NDELAY option on the incoming pipes so that I can check for the presence of data in a pipe without hanging so each end is not trapped in a wait for IO state. At each end I want to be able to check for input from other places. To be a little more precise, the parent is in a loop doing: Poll keyboard; process if input Poll pipe from child; process if input and the child is doing Poll Pipe A; process if input Poll Pipe B; process if input or Input X; process Poll Pipe B; process if input However, my problem is that things are slow. I need to do further investigation, but it seems to me that there is a very long cycle until my processes are rescheduled. (About 1 sec). I have turned off the multi-screens, but nothing else yet. Poth parent and child can be in what amounts to a busy wait, so will not be rescheduled unless the read system calls do this with O_NDELAY set. I suspect the parent uses up a time slice, then next time the child gets scheduled and uses a time slice. What is the cause of the slow operation? Can I change the length of the time slice? What causes the long cycle before my processes are rescheduled? Does read with O_NDELAY cause rescheduling, or is it effectively a busy wait? Am I doing something wrong? What other ways can I poll devices as described without this large delay? Peter Horan -- Peter Horan peter@cm.deakin.oz.au