From: Rodrigo Real <rreal@ucpel.tche.br>
To: Manfred Scherer <manfred.scherer.mhm@t-online.de>
Cc: linux-msdos@vger.kernel.org
Subject: Re: Cobol app takes 100% CPU
Date: Mon, 31 Mar 2008 10:46:13 -0300 [thread overview]
Message-ID: <87prtbj9ay.fsf@pequena.ucpel.tche.br> (raw)
In-Reply-To: <200803301612.24741.manfred.scherer.mhm@t-online.de> (Manfred Scherer's message of "Sun, 30 Mar 2008 16:12:24 +0200")
Hi Manfred
Changing idle first parameter to 10 didn't help, but changing it to 1
or 2 slowed down the cobol app. I was changing e-mails with Bart
privatetly about that. The problem with this approach is that when the
app really needs the cpu, for generating reports, it also runs slow, I
guess because it keeps updating a number on the screen.
After some debugging I identified an AX pattern when the app is in the
menus, which is the main problem of this app, so I only slow down
dosemu when I detect this pattern:
--- ../dosemu-1.4.0/src/base/bios/int16.c 2007-05-04
02:59:48.000000000 -0300
+++ src/base/bios/int16.c 2008-03-28 15:10:13.000000000 -0300
@@ -112,16 +112,22 @@
static unsigned check_key_available(int extended)
{
+ static int oldAX=0;
unsigned keyptr = get_key(extended);
if(keyptr == -1) {
if(!port60_buffer || (port60_buffer & 0x80))
trigger_idle();
else
reset_idle(0);
- idle(500, 20, 0, INT2F_IDLE_USECS, "int16");
+/* printf ("AX=%x\n",_AX); */
+ if (_AX == 0x1100 && oldAX==0x1103 ) /* here I detect the pattern */
+ idle(2, 20, 0, INT2F_IDLE_USECS, "int16");
+ else
+ idle(500, 20, 0, INT2F_IDLE_USECS, "int16");
} else {
reset_idle(1);
}
+ oldAX = _AX;
return get_key(extended);
}
This is a sort of dirty solution, but it worked fine...
Thanks,
Rodrigo
Manfred Scherer <manfred.scherer.mhm@t-online.de> writes:
> Hi all,
> I have had the the same problem with other programs i.e. dbase 3+ word 4.0 ...
> in dosemu 1.3.4 I have made a small change in
> src/base/bios/int16.c in function check_key_available():
>
> here is the code for dosemu 1.3.4, I think this is equal to 1.4.0:
>
> static unsigned check_key_available(int extended)
> {
> unsigned keyptr = get_key(extended);
> if(keyptr == -1) {
> if(!port60_buffer || (port60_buffer & 0x80))
> trigger_idle();
> else
> reset_idle(0);
> /* 2006-12-13
> * dbase3+, word4.0, .... CPU-load is to heavy during idle. --ms
> * idle(500, 20, 0, INT2F_IDLE_USECS, "int16");
> */
> idle(10, 20, 0, INT2F_IDLE_USECS, "int16");
> } else {
> reset_idle(1);
> }
> return get_key(extended);
> }
>
> I think that may help for Cobol too.
>
> Manfred
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2008-03-31 13:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-30 14:12 Cobol app takes 100% CPU Manfred Scherer
2008-03-31 13:46 ` Rodrigo Real [this message]
2008-03-31 9:47 ` Manfred Scherer
-- strict thread matches above, loose matches on Subject: below --
2008-03-26 12:55 Rodrigo Real
2008-03-26 15:28 ` Frank Cox
2008-03-27 12:11 ` Rodrigo Real
2008-03-27 14:20 ` Frank Cox
2008-03-27 15:57 ` Bart Oldeman
2008-03-27 17:53 ` Rodrigo Real
2008-03-27 17:53 ` Mike McCarty
2008-03-27 18:11 ` Rodrigo Real
2008-03-30 20:37 ` Jan Kandziora
2008-03-31 1:18 ` Rodrigo Real
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87prtbj9ay.fsf@pequena.ucpel.tche.br \
--to=rreal@ucpel.tche.br \
--cc=linux-msdos@vger.kernel.org \
--cc=manfred.scherer.mhm@t-online.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.