File descriptors as register windows?
Posted: Wed Oct 02, 2013 3:52 pm
I just thought of something today and it is probably stupid but I'm just gonna explain it so you can contemplate it for five minutes before you discard it as gibberish. I honestly haven't given it a lot of thought myself.
I just thought, what would happen if you handle file descriptors the same way as registers are handled when using register windows? So let's say a task has 8 file descriptors 0 ... 7 it can use. Descriptor 0 would be the standard in and descriptor 7 would be stdout. Then when you fork and execute a new program the "file descriptor window" would be moved forward and stdin for the new task would now be the old stdout. The descriptors 1..6 would always be local to a task. Could this be used in some new and exciting way perhaps? What would the pros and cons be?
I just thought, what would happen if you handle file descriptors the same way as registers are handled when using register windows? So let's say a task has 8 file descriptors 0 ... 7 it can use. Descriptor 0 would be the standard in and descriptor 7 would be stdout. Then when you fork and execute a new program the "file descriptor window" would be moved forward and stdin for the new task would now be the old stdout. The descriptors 1..6 would always be local to a task. Could this be used in some new and exciting way perhaps? What would the pros and cons be?