Pre-emptive multitasking

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
pepito

Pre-emptive multitasking

Post 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
knicos

RE:Pre-emptive multitasking

Post 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.
pepito

RE:Pre-emptive multitasking

Post 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
pepito

RE:Pre-emptive multitasking

Post 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
carbonBased

RE:Pre-emptive multitasking

Post 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
pepito

RE:Pre-emptive multitasking

Post 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
carbonBased

RE:Pre-emptive multitasking

Post 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
Post Reply