Re: Terminate and Stay Resident Software (TSR) in Linux



Hello,

Your program would just wait for input. The process running your
program would then not be scheduled until some input comes.

Do you mean it is not running at all if no input comes through?
I thought every process gets at least a time slice every now and then.
Is this assumption thereby wrong?

Why give a timeslice to a process waiting for input that the scheduler
knows has not received that input? That's just a waste of resources.

Yes, that was my idea, too. I did not know how/if it's done.
I'll get the Minix book at Christmas, so I can then read some more about the
real low-level stuff. I have read a lot, but not about everything. A good
book is worth more than a thousand web sites, I think...

In my opinion a process which waits would react to a time slice with
something like "Oh, I've got nothing to do, scheduler, switch to your
next
process".

If waiting from incoming connections, use listen, from incoming
data from a socket use recv... and so on.

You mean blocking calls interfere with the low-level scheduler so that
the
program simply don't get cpu time?

The low-level scheduler should be aware of what is blocking various
threads and only bother to wake them up (or at least add them to the run
queue) when the block is cleared.

Thank you for your answer. I did not know this was possible.
I'm not much of a programmer, but that will change.

Regards,
Sebastian


.