dv@well.UUCP (David W. Vezie) (11/03/85)
I would like to hear what people think about this question: I am writing a shell that does some esoteric stuff with the terminal. It could either do it in cooked mode (making good use of the t_brkc (4.2 BSD in this case)) or in cbreak mode (where it does all the erase word kill line kill in user mode in the process itself). My question is this: which is faster? And which is "cleaner?" Is it better to put it in the kernel and let the kernel worry about erase/kill stuff along with my own stuff (possibly adding a second t_brkc (for those of you who don't know (I'm not sure if brkc is in SysV), brkc is a character that operates in cooked mode and acts as a newline (terminating the line, gets echoed, and gets passed back to the user))), or is it better to make the user program worry about the all the normal input editing stuff (basically imitate the kernel in cooked mode) as well as the additional stuff? There are advantages of both, I think. To put it in user mode is cleaner (it doesn't entail any kernel changes, and keeps the kernel as empty as possible), while to put it in the kernel would probably be faster (only one context switch per normal line as opposed to every character). Comments? -- David W. Vezie /!well!dv - Whole Earth 'Lectronics Link, Sausalito, CA {dual|hplabs} (4 lines, 166 chars) \!unicom!dave - College of Marin, Kentfield, CA