[Xitami] Xitami on BeOS

Paul Reid xitami@lists.xitami.org
Thu, 28 Jun 2001 12:11:06 -0400


> [in BeOS] cpu load ... goes up to 100% and stays there

Does it yield? That is, when you do other work on the machine, does it
feel slow? 

I don't know BeOS, but in Windows many DOS apps will send the CPU Use
meter to the max yet the machine feels only 5%-10% slow in other
applications. 

In Windows, a proper app is supposed to give up its time slice if it has
nothing to do. DOS apps assume they own the whole machine. Many of them,
when "doing nothing" sit in a tight loop asking "Did user press a key
yet?", asking that question 750,000,000 times a second on modern CPUs.
Windows can't be sure if the DOS app's frenzy is doing something useful
or not. So if no other app is demanding cycles, the DOS app gets most of
the CPU's time. If another app does have something to do, it gets the
time it needs, and the DOS app gets just a few cycles on every loop of
the Windows task-switcher. 

Sometimes the DOS app appears to Windows to be greedy; I have a DOS
modem program that -will- slow the rest of Windows if it has trouble
opening the modem (because Windows has grabbed the modem for DUN). 

BTW, there are some tricks for time-sharing background programs in
Windows (NT). A main one is to "Stall" a DOS app when it is in the
background, so it gets no time when you are not using it. Good for a
text editor, bad for a web server. There are other priority options,
though I must note that some cause more trouble than they are worth.
(Don't put a DOS app in RealTime priority or you'll never get control
back!)

Clearly the BeOS compile of Xitami is not supporting whatever
load-sharing that BeOS has. Of course it is interesting that Xitami
works at all on a platform that isn't really a classic unix and isn't
DOS/Win or OS/2, the platforms that got specific support. 

There is of course a native web server in BeOS. And I'd guess that the
total BeOS webserver market is too small for anybody to spend a lot of
programming time on. But since Xitami itself runs on one big loop,
anybody who really knows BeOS's load-share technique (or who can find
similar code in some other BeOS application) could add a "Nothing to do
right now" flag to release the current time-slice back to BeOS.

 -PRR