forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CPU OVERLOAD

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
baldeagle



Joined: 08 Oct 2007
Posts: 3
Location: Tenn USA

PostPosted: Tue Oct 09, 2007 8:57 pm    Post subject: CPU OVERLOAD Reply with quote

I have been using the Personal Edition of FTN95 and have found it to work perfectly on a number of programs, each with 3000+ lines of code. However, even on a minimum number of lines of code, the CPU is heavily loaded, even when no program functions are in progress (i.e., waiting for keyboard input). The CPU is an Intel Core-2 6600 at 2.4 GHz with 2 Gigabytes of RAM. The programs respond the same way on my laptop computer, but it cannot support the load indefinitely without overheating the CPU. One is running MS-Vista and the other one is running MS-XP.

The overload only occurs when a window is open. The following code is used to open the window.
WINAPP
INCLUDE <WINDOWS.INS>
--------------------------------------------------------------
--------------------------------------------------------------
NEWFONT=CREATEFONT(LFHEIGHT,LFWIDTH,LFESCAPEMENT,
+ LFORIENTATION,LFWEIGHT,LFITALIC,LFUNDERLINE,
+ LFSTRIKEOUT,LFCHARSET,LFOUTPRECISION,
+ LFCLIPPRECISION,LFQUALITY,LFPITCHANDFAMILY,LFFACENAME)
C/////DEFAULT FONT SET AND WINDOW SIZE SET
CALL SET_DEFAULT_FONT@(NEWFONT)
XSIZE=CLEARWIN_INFO@('SCREEN_WIDTH')
YSIZE=CLEARWIN_INFO@('SCREEN_DEPTH')
XPOS=0
YPOS=0
NWIN=CREATE_WINDOW@(
+ 'XXXXXOOOOOXXXXXOOOOOXXX',
+ XPOS,YPOS,XSIZE,YSIZE)
CALL SET_DEFAULT_WINDOW@(NWIN)
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7926
Location: Salford, UK

PostPosted: Tue Oct 09, 2007 9:26 pm    Post subject: Reply with quote

CREATE_WINDOW@ and similar routines are obsolete. It is recommended that you use WINIO@ instead.

If you want to post a small but complete working program then I could look at it but it would be better if you changed to WINIO@.
Back to top
View user's profile Send private message AIM Address
baldeagle



Joined: 08 Oct 2007
Posts: 3
Location: Tenn USA

PostPosted: Tue Oct 09, 2007 9:59 pm    Post subject: Reply with quote

Enclosed is a simple test program as you requested. It runs perfectly, but the CPU loading is more than 50 percent. As a comparison, Microsoft Word 2007 only creates 1 to 2 percent CPU loading.

It would be great if there were a simple fix, since it is so easy to convert existing 3000+ line programs for FTN95, especially when there is a large amount of keyboard interaction.

C/////THIS IS A DUMMY TEST PROGRAM TO TEST CPU LOADING
C/////CPU LOAD IS MORE THAN 50 PERCENT AT "READ" 4 LINES FROM BOTTOM
WINAPP
INCLUDE <WINDOWS.INS>
INTEGER XSIZE,YSIZE,XPOS,YPOS
INTEGER NEWFONT,LFHEIGHT,LFWIDTH,LFESCAPEMENT,
+ LFORIENTATION,LFWEIGHT,LFITALIC,LFUNDERLINE,
+ LFSTRIKEOUT,LFCHARSET,LFOUTPRECISION,
+ LFCLIPPRECISION,LFQUALITY,LFPITCHANDFAMILY
CHARACTER LFFACENAME*80,HOLD*1
C/////VALUES ASSIGNED TO FONT PARAMETERS
LFHEIGHT=32
LFWIDTH=14
LFESCAPEMENT=0
LFORIENTATION=0
LFWEIGHT=700
LFITALIC=0
LFUNDERLINE=0
LFSTRIKEOUT=0
LFCHARSET=0
LFOUTPRECISION=1
LFCLIPPRECISION=2
LFQUALITY=2
LFPITCHANDFAMILY=34
LFFACENAME='COURIER NEW'
C/////NEW FONT CREATED FOR FORMAT WINDOW
NEWFONT=CREATEFONT(LFHEIGHT,LFWIDTH,LFESCAPEMENT,
+ LFORIENTATION,LFWEIGHT,LFITALIC,LFUNDERLINE,
+ LFSTRIKEOUT,LFCHARSET,LFOUTPRECISION,
+ LFCLIPPRECISION,LFQUALITY,LFPITCHANDFAMILY,LFFACENAME)
C/////DEFAULT FONT SET AND WINDOW SIZE SET
CALL SET_DEFAULT_FONT@(NEWFONT)
XSIZE=CLEARWIN_INFO@('SCREEN_WIDTH')
YSIZE=CLEARWIN_INFO@('SCREEN_DEPTH')
XPOS=0
YPOS=0
NWIN=CREATE_WINDOW@(
+ 'THIS IS A TEST PROGRAM',
+ XPOS,YPOS,XSIZE,YSIZE)
CALL SET_DEFAULT_WINDOW@(NWIN)
CALL CLEAR_WINDOW@(NWIN)
WRITE(*,'(''THIS IS A TEST'')')
READ(*,'(A1)')HOLD
CALL DESTROY_WINDOW@(NWIN)
STOP
END
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7926
Location: Salford, UK

PostPosted: Wed Oct 10, 2007 7:14 am    Post subject: Reply with quote

OK, but have you tried the following approach...

Code:

WINAPP
READ*,x
PRINT*,x
END
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7926
Location: Salford, UK

PostPosted: Wed Oct 10, 2007 7:29 am    Post subject: Reply with quote

I have tried your program and I can see the problem that you describe.

My simple program also exhibits the same problem.

We will investigate. At this point I do not know if it will be easy to fix.

The good news is that, if you run both your program and mine simultaneously then they each use about half of the CPU so the programs are not blocking other programs from taking a share of the CPU.
Back to top
View user's profile Send private message AIM Address
JohnHorspool



Joined: 26 Sep 2005
Posts: 270
Location: Gloucestershire UK

PostPosted: Wed Oct 10, 2007 8:21 am    Post subject: Reply with quote

Paul,

The problem that Baldeagle describes has nothing to do with a window being open. It has always been the case with FTN95, FTN77 that whilst the program is waiting for user input via a fortran READ statement that task manager shows the application has loaded the CPU up to 99%. A non-windows DOS program does the same high CPU loading.

Baldeagle,

If you use winio@ with %rd, %rf , %rs to enter integer, real and character data then you will see that the CPU loading of the application will be listed as 0% by task manager.


Of course the fortran READ statement is an original part of the language created long before multi-tasking had even been dreamt of.

I hope this helps.

regards,
John
Back to top
View user's profile Send private message Visit poster's website
baldeagle



Joined: 08 Oct 2007
Posts: 3
Location: Tenn USA

PostPosted: Wed Oct 10, 2007 3:43 pm    Post subject: Reply with quote

The issue wih the READ statement, which JohnHorspool described, is the cause of the CPU loading. Using winio@ for input reduces the CPU loading to a negligile level. It would have been convenient to leave the large number of READ statements in place, but this is a workable alternative.

Thanks for the help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group