English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 22 June 2009, 20:32   #1
ppill
CON: artist
 
ppill's Avatar
 
Join Date: Feb 2006
Location: Poland
Age: 43
Posts: 1,250
Making commands resident.

Here are a couple of simple questions for the experts out here:

How does making a command resident differ from copying to ram: and running it from there? Does it somehow prep the executable (loads the required hunks)?

Thanks
ppill is offline  
Old 22 June 2009, 21:01   #2
Bloodwych
Moderator
 
Bloodwych's Avatar
 
Join Date: Jun 2001
Location: I'm behind you!
Posts: 3,763
I may be wrong, but I think it means only one copy is needed to run multiple processes involving that command.

Hence why Execute and Assign are made resident in the standard startup-sequence as they are called for many times during boot.

If you execute the command from RAM, it's less efficient and uses more resources/reads/copies of the command for multiple calls and processes.

The "pure"/P flag identifies commands that can be made resident.

Someone will probably have a technical explaination soon enough!

Last edited by Bloodwych; 22 June 2009 at 21:07.
Bloodwych is offline  
Old 22 June 2009, 21:12   #3
ppill
CON: artist
 
ppill's Avatar
 
Join Date: Feb 2006
Location: Poland
Age: 43
Posts: 1,250
But is it just that? Some programs cannot be made resident (self-modifying code?) but still can be run from RAM:.

Maybe someone can shed more light on this
ppill is offline  
Old 22 June 2009, 21:55   #4
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,025
Get a computer lexicon and learn about terms like reusable and reentrant. A program which can be made resident must be reentrant.
thomas is offline  
Old 23 June 2009, 00:58   #5
Ed Cruse
Registered User
 
Join Date: Sep 2007
Location: Las Cruces, USA
Age: 71
Posts: 351
Making a command resident simply loads it into memory and sets it up the same way typing the command at the prompt does, except no process is created to run it. Then everytime you type the name of the command at the prompt the system knows that's it's already set up so it only creates a process to run it. This is faster and uses less memory, but the program has to be reentrant because more then one process can run the code at the same time.

If you run a non resident command more then once at the same time it's loaded and setup in memory each time, using more memory. Running from ramdisk doesn't change that, it's no different then loading the program from disk, other then being possibly faster loading.

It's mostly useful when using batchfile commands like 'if' because they're already loaded and setup so they're faster.

I've used the resident command when doing sound effects for plays. The last one I did I loaded 8 audio players with different Arexx port names, each player doing a different sound file. Instead of loading the audio player 8 times using the 'run' command and using up all that memory, I first made it resident, and then loaded the audio player 8 times using the 'run' command. 8 process were created all running the same code, and yes, the audio player is reentrant.
Ed Cruse is offline  
Old 23 June 2009, 09:02   #6
ppill
CON: artist
 
ppill's Avatar
 
Join Date: Feb 2006
Location: Poland
Age: 43
Posts: 1,250
Quote:
Originally Posted by Ed Cruse View Post
Making a command resident simply loads it into memory and sets it up the same way typing the command at the prompt does, except no process is created to run it.
So there is some startup magic involved after all

Thanks for the info Ed!
ppill is offline  
Old 23 June 2009, 23:16   #7
Ed Cruse
Registered User
 
Join Date: Sep 2007
Location: Las Cruces, USA
Age: 71
Posts: 351
Quote:
Originally Posted by ppill View Post
So there is some startup magic involved after all

Thanks for the info Ed!
Glad I could help.
Ed Cruse is offline  
Old 24 June 2009, 13:10   #8
Doc Mindie
In deep Trouble
 
Join Date: Sep 2004
Location: Manchester, Made in Norway
Age: 51
Posts: 841
I always made the E-compiler resident via "resident E:bin/EC PURE" in startup-sequence due to me not fancying to write the whole path everytime I compiled my test projects way back when

Dirty trick, I know.... on the other hand, it saved me from having non-system files on the sys: partition

*sigh* (offtopic) too bad my HD went byebye in '96.... I had just about started to get the hang of AmigaE when it happened
Doc Mindie is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Resident Evil Demo XDelusion request.Old Rare Games 6 29 March 2016 22:47
Zip help commands mickolite support.Apps 5 16 June 2011 21:00
What is required of a resident application? Leffmann Coders. General 6 03 April 2010 22:50
Resident magazine module mailman request.Modules 4 26 December 2009 14:56
ROM resident HRTMon Toni Wilen Coders. General 24 09 January 2008 09:33

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:42.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07847 seconds with 12 queries