Control Program for Device Driver Process

AI Thread Summary
The control program for a device driver operates in an infinite loop, managing I/O requests from user processes. Polling for command completion can negatively impact multiprogramming by monopolizing CPU time, preventing other processes from executing while waiting. Without Direct Memory Access (DMA), the CPU's involvement in data transfer can further hinder multiprogramming efficiency. Multi-threading is highlighted as a solution to optimize CPU usage by allowing concurrent execution of tasks within the same process. Overall, effective management of I/O processes is crucial for maintaining system performance in multiprogramming environments.
D a M i E n
Messages
5
Reaction score
0
Code:
The control program for a device-driver process is an infinite loop.
Roughly, the loop body is: wait for I/O request from user process; send 
I/O command to device; wait for command completion; notify (unblock) user
process.

    a) [10 marks] Suppose the device driver waits by polling the device for
    command completion.  How does this affect multiprogramming?

    b) [10 marks] Assume there is a timer interrupt 60 times a second.  Can
    you find a reasonable solution for waiting that does not use device 
    interrupts?  If you find one, describe it.


Help please !
 
Computer science news on Phys.org
Ok, so where is your attempt at solving the problem?
 
What does "how does this affect multiprogramming" mean?

Hi Ho! :smile:

I know that multiprogramming is a technique of loading several programs into the main memory at once so that when one program is waiting for the I/O process to finish, the CPU can be kept busy by executing another program.

So, I wonder in what way the I/O process is going to affect multiprogramming because as far as I know there is no correlation between the number of programs that can be loaded into the main memory and the time a program must wait for the I/O process to finish.

I also have a similar question like that, which is "if a computer does not employ DMA, the CPU must take care the transfer of data from an I/O device to the memory, or from the memory to an I/O device. So, how does this affect multiprogramming?"

I think multiprogramming will be affected in a way that there is no good reason of loading too many programs into the main memory if DMA is not employed, since with a small amount of programs in the main memory, the CPU will be busy enough.

What do you think?

Regards,
Eus
 
Hey Eus..

Excuse me for wondering if you ever heard of multi threading...?

How is this really any different ?

Please explain.

Respectfully.

Aquafire
 
Hi Ho! :smile:

Thread is a light-weight process because it uses the same address space (core image) of the instantiating process.

Creating a process is a much expensive business since a process must have its own address space (program text, data, and stack), whereas a thread shares its parent's data, and perhaps, program text.

So, multi-threading is a technique of instantiating many threads from a program (the parent process) to tackle a big job in such a way that does not exhaust the main memory but keeps the CPU busy all the time.

For example, if you do a recursive quick sort like:

sort (0, middle);
sort (middle+1, end);

the first function that you call to sort [0, middle] must return first before the function to sort the rest will work.

But, if you employ multi-threading like:

threadSort (0, middle).start; // 1
threadSort (middle+1, end).start; // 2

both of the "functions" will work in turn like:
1 1 1 1 2 2 2 2 1 2 2 1 1 2 2 1 ...

So, generally multi-threading employs multi-programming in a way that each thread can maintain its own local variables in the main memory so that the CPU can execute one of the thread in case the CPU is idle.

Regards,
Eus
 
In my discussions elsewhere, I've noticed a lot of disagreement regarding AI. A question that comes up is, "Is AI hype?" Unfortunately, when this question is asked, the one asking, as far as I can tell, may mean one of three things which can lead to lots of confusion. I'll list them out now for clarity. 1. Can AI do everything a human can do and how close are we to that? 2. Are corporations and governments using the promise of AI to gain more power for themselves? 3. Are AI and transhumans...
Thread 'ChatGPT Examples, Good and Bad'
I've been experimenting with ChatGPT. Some results are good, some very very bad. I think examples can help expose the properties of this AI. Maybe you can post some of your favorite examples and tell us what they reveal about the properties of this AI. (I had problems with copy/paste of text and formatting, so I'm posting my examples as screen shots. That is a promising start. :smile: But then I provided values V=1, R1=1, R2=2, R3=3 and asked for the value of I. At first, it said...
Back
Top