Page 1 of 1
Pre-emptive multitasking
Posted: Wed Oct 01, 2003 11:00 pm
by pepito
In a pre-emptive multitasking OS:
Must the console (keyboard-screen) be assigned to just one process?
How handle the console I/O when are many process runing?
Thank you very much,
pepito
RE:Pre-emptive multitasking
Posted: Thu Oct 02, 2003 11:00 pm
by knicos
I have the same problem, so i restricted it to one program at a time, and it behaves as an open locked file, so when the program using it closes the file it will allow others to open. A shell would close the console and allow another program to have it, then when program is finished the shell will reopen the console. If you have a gui, its completely different.
RE:Pre-emptive multitasking
Posted: Thu Oct 02, 2003 11:00 pm
by pepito
Thank you!
I have been thinking about the problem and I understand I need asign the console to one task at a time as you say, then one task will have "the focus".
What you think about other hardware like disks drives and sound cards?
pepito
RE:Pre-emptive multitasking
Posted: Thu Oct 02, 2003 11:00 pm
by pepito
Another question, I don't have a GUI yet but I will write one in the future.
Why you think with a GUI the method is different?
pepito
RE:Pre-emptive multitasking
Posted: Fri Oct 03, 2003 11:00 pm
by carbonBased
Without a GUI, perhaps the best method would be to supply virtual console to each task. Of course, only one task's console can be displayed at once, but if they each have their own, they can each process request separately. The process of deciding which console to display is up to the OS, of course.
As for the GUI, the concept is different simple because each process MUST be able to access the "console" (aka, the display) at once... in a GUI environment, of course, the screen is shared by many programs, and so you must device a windowing system that allows this.
Cheers,
Jeff
RE:Pre-emptive multitasking
Posted: Sun Oct 05, 2003 11:00 pm
by pepito
Thank you!
I understand that using a GUI still exist only one task that have the "focus" and all keyboard input go directly to it. Is that true?
What about the mouse?
pepito
RE:Pre-emptive multitasking
Posted: Mon Oct 06, 2003 11:00 pm
by carbonBased
Yes. In most GUIs, the currently selected/highlighted window has mouse and keyboard focus, and is the only app that can process these events. All other tasks, however, still continue to execute.
In some GUI's, it's certainly possible for one window to have keyboard focus, while another (or many others, perhaps, if there's a notion of layers, or transparency) have mouse focus, however.
Cheers,
Jeff