On 2008-10-09, at 06:13, Joshua Juran wrote:
On Oct 3, 2008, at 5:32 AM, Peter da Silva wrote:
On 2008-10-03, at 02:47, Joshua Juran wrote:
I used to have what-to-do-on-close logic in the kernel, but now the window will always close when the last file descriptor referring to it is closed. So run a trivial program that does "while ( true ) pause();" to keep it open.


I don't need to do that to keep a file in the file system from being deleted, why should I have to do that when I just want to redirect the output of "ls" to a new window?


Well, piping it into a program isn't any harder, is it?

Yes, it is. Among other things, you don't just open files from the shell. And, yes, popen exists, but if you're dealing with an already existing program that's not an option.

Pipes and filters and redirection is a human tool, at least as much as a scripting tool. The UNIX shell is a very humanistic API, it's something created for people to use, directly, casually, if you have to do things like writing a program to keep a file open, you might as well be using JCL.


Okay, so you're modeling the window as a file. Does that mean you'd close the window by calling unlink() on its pathname?

The UNIX model for deleting file system objects works fine here. The name of the file is not the file, it's simply a reference to the object. Open file descriptors are additional references to the object. When the last reference to the object is gone, the object is deleted. In this case, the window system itself a reference.

My concern here is how to close the window programmatically.

If you want to close the window programatically, then you give it something like a "retain=none" option. Or you don't open it with / anon/. You open it with something that gives you a permanent name, like say:

        /dev/win/private/$nonce/initial-settings

Or maybe:

        /proc/$$/win/$nonce/initial settings

Or for a shared window:

        /dev/win/shared/$$/initial-settings

Or:

        window=`cat /dev/win/clone`
        echo $window
        /dev/win/shared/3562a29e-4aaa...

If you're going to close it under program control, you probably want to be able to do things like resize it under program control as well.

I upgraded my 7600 from 9.22 to 10.1.5 and all of a sudden I could play music while using the file system without having dropouts. Yes. Really. Just using the file system from another program, any other program, would bring the Great Multitasking Charade to a screeching halt and the music ended.


I wonder if your audio player wasn't using interrupt-driven I/O. Or maybe you were running File Sharing?

Why the hell should I have to care about that? That's stuff that any multitasking OS written after the mid-70s should be taking care of. I shouldn't have to care about whether an application was driven by software interrupts, hardware interrupts, polling, system events, sockets and select, mailboxes and SYS$ calls, QIO$W, Intuition message ports, ... all that stuff was abundantly documented for any system programmer back before the two Steves thought Sweet-16 was new and exciting. The idea that I should have to think about something like that in software shipping in 1999 makes me actively nauseous.

I do know some of the reasons why this kind of thing happens on OS 9. I Do Not Care. If anything, it makes me look at OS 9 with more horror and disgust. I could sort of live with it with System 7, because I "knew" it was just a short term problem, they had System 6 running under A/UX and they'd finish replacing the underlying crap with a reasonable kernel and they were already talking about a new API that would surely get rid of "GetNextEvent" and Handles and all the other legacy of cramming a GUI into 128K.

Back then, it was already on life support and dying of gangrene, but I could hold my nose and avoid lifting the covers... they were going to put it out of its misery. When they announced the Power PC I figured the old API would only be used under emulation.

Boy was I ever wrong. They kept the corpse moving with string and a broomstick, hooked up a PPC battery and ran hundreds of wasted megahertz through the body, and managed to create a kind of technological zombie, a semblance of life drawn from the pain of programmers and the faith of the fans.

By 1999, that wasn't even a zombie any more. It was a midden with wicker bones, as full of life as a dead dog on an anthill.

Reply via email to