Skip to contentSkip to conversation

Dosemu and clipper applications eating all CPU

DISCUSSION Stas Sergeev 2 participants 2 messages Mar 15, 2004

lore
Share & tools
lore
#0 lore raw

Hello.

Quoted 1 line · Maurilio Longo

it probably depends on the linker used to create the clipper app, here we use blinker to create a protect mode application

Yes, the prog I now have, also uses blinker.
Btw, in both dosemu-1.2.1 and 1.3.0 it works only in real mode since the proper Blinker support was added only in 1.3.1. Does your prog work in real or protected mode for you?

Quoted 1 line

In 1.1.3 (which is the dosemu we use)

1.1.3 is too old and buggy. Why are you still using it? 1.3.0 or 1.3.1 should be much better.

Quoted 2 lines

I had to make the changes I told you, and I
use hog_threshold(0) to have the clipper app to give back all the time it doesn't use.

OK, but not everything is clear.
You said you call usleep() every 50th call and set $_hogthreshold=(0).
But then, if you set $_hogthreshold=(1) with an unmodified dosemu, it should call usleep() on *every* call of int21/ah=2c, so it must release much more CPU time! How it happens that it doesn't? (please see int.c line 1201, where 0x2c is trapped).

#1 lore raw

Stas,

Quoted 10 lines
Quoted 2 lines

it probably depends on the linker used to create the clipper app, here we use blinker to create a protect mode application

Yes, the prog I now have, also uses blinker.
Btw, in both dosemu-1.2.1 and 1.3.0 it works only in real mode since the proper Blinker support was added only in 1.3.1. Does your prog work in real or protected mode for you?

it is in protect mode, I don't know if it could run at all in real mode.

Quoted 5 lines
Quoted 1 line

In 1.1.3 (which is the dosemu we use)

1.1.3 is too old and buggy. Why are you still using it? 1.3.0 or 1.3.1 should be much better.

I've switched to 1.2.1 the other day and set hog_threshold to 45, but it uses nearly 60% of cpu while completely idle (lower values make serial transmission stop working) and 99% of cpu while inside dos prompt.

Quoted 4 lines
Quoted 4 lines

I had to make the changes I told you, and I
use hog_threshold(0) to have the clipper app to give back all the time it doesn't use.

Quoted 11 lines

OK, but not everything is clear.
You said you call usleep() every 50th call and set $_hogthreshold=(0).
But then, if you set $_hogthreshold=(1) with an unmodified dosemu, it should call usleep() on *every* call of int21/ah=2c, so it must release much more CPU time! How it happens that it doesn't? (please see int.c line 1201, where 0x2c is trapped).
-

Yes, it _does_ and this makes our clipper program unresponsive to user commands, so I changed INT2F_ to INT28_IDLE_SEC and it was better but not enough, so I put the 50 calls per usleep() hack, and this way it is responsive and cpu is around 1, 2%.

But the problem, in my opinion is that usleep() sleeps a fixed amount of time (either INT2F_IDLE_SEC or INT28_IDLE_SEC) while it should simply (if at all possible on linux) give back the rest of current time slice, this way if it has someting to do for, let's say, 1/10th of its time slice, it does it and then gives 9/10th back to linux instead of sleeping for a certain _fixed_ amount of time.

regards.

--
__________

|  |  | |__| [email protected]
|_|_|_|____| Team OS/2 Italia