Linux MS DOS discussions
 help / color / mirror / Atom feed
From: Rodrigo Real <rreal@ucpel.tche.br>
To: linux-msdos@vger.kernel.org
Subject: Re: Cobol app takes 100% CPU
Date: Thu, 27 Mar 2008 09:11:33 -0300	[thread overview]
Message-ID: <87ej9wpdsa.fsf@pequena.ucpel.tche.br> (raw)
In-Reply-To: <20080326092813.df658a5e.theatre@sasktel.net> (Frank Cox's message of "Wed, 26 Mar 2008 09:28:13 -0600")


Hi Frank

Frank Cox <theatre@sasktel.net> writes:

> On Wed, 26 Mar 2008 09:55:20 -0300
> Rodrigo Real <rreal@ucpel.tche.br> wrote:
>
>> This cobol app always tried to eat the most of cpu it can, with 10 or
>> 12 users the situation were acceptable, but now with 26 it is been
>> very hard to work.
>
>
> Have you tried Tame?

I once took a look at Tame, but didn't tried it, since it was a paid
software and I didn't know anything about it, I just didn't pay
attention. But it is good to know that it works.

When you answered my question I was in the middle of a solution and
followed it until the end.

I decided to hack dosemu code to limit its cpu usage. I made some
tests that were very fine, and found a solution for me.

In the end I changed only two lines of code. In src/include/timers.h I
multiplied by 1000 the JIFFIE_TIME, so it became:

-#define JIFFIE_TIME            (1000000/sysconf(_SC_CLK_TCK))
+#define JIFFIE_TIME            (1000000000/sysconf(_SC_CLK_TCK))

And in src/base/bios/int16.c I added a usleep before
check_key_available call:

   case 0x11:
+    usleep(INT2F_IDLE_USECS/100000);
     check_key_available(EXTENDED);
     break;

Now the load of the server is less them one, even with 20 dosemu
processes running, before that changes the load would be in 12. And
the users are very happy with the performance.

Don't know if this is a good forum for that, but I guess that this
sort of thing should be a parameter, so users can calibrate their
speed. Maybe I am missing something, but I guess that many dosemu
users would be in a situation similar to mine.

Thanks for helping!

Cheers,
Rodrigo

  reply	other threads:[~2008-03-27 12:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-26 12:55 Cobol app takes 100% CPU Rodrigo Real
2008-03-26 15:28 ` Frank Cox
2008-03-27 12:11   ` Rodrigo Real [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2008-03-30 14:12 Manfred Scherer
2008-03-31 13:46 ` Rodrigo Real
2008-03-31  9:47   ` Manfred Scherer

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=87ej9wpdsa.fsf@pequena.ucpel.tche.br \
    --to=rreal@ucpel.tche.br \
    --cc=linux-msdos@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox