[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: re-entrant programs



dockery@griffin.cuc.ab.ca (Sean Dockery) writes:

>This is a repost of a message which (should have) appeared on
>comp.sys.apple2 a little while ago.  I received no responses to the
>message so I can only assume that it was lost in the internet.

>---repost starts---

>I have often heard the term describing software to be "re-entrant."
>The context under which I have heard it most used was an opinion that
>the Apple IIgs tools and GS/OS would be easier to work with if they
>were re-entrant.

>Would someone please enlighten me with the answers to the following:

>	o What qualifies an application as re-entrant?

   're-entrant' means that more than one process may execute the program
at the same time.  Usually the term is applied only to subroutines
of a program.. recursive subroutines are reentrant, and that should
give us a starting point.
  
>	o What are some examples of re-entrant software?

  As I mentioned above, recursive subroutines.  Usually, program
segments that are reentrant store all variables on the CPU stack;
thus, as long as each process (concurrently running programs that might
share tool calls, for example) has a different stack, reentrant 
libraries and tools greatly simplify the other work that's necessary
to make multitasking work.

>	o What are some advantages and disadvantages of an application
>	   that is re-entrant?

  Reentrant code may or may not be larger than non, but it usually is 
slightly larger and slightly slower than non-reentrant code.

>	o Are re-entrant applications significantly larger that
>	   others that perform the same task?

  No, I'd say 'slightly'.  But it depends on the task.  On average
(and from experience) they're about the same.  Of course, in a multitasking
system, reentrance actually speeds things up because you then don't
have to manage global variable arbitration, which can involve lots
of CPU time.

>From reading comp.sys.apple2, I believe that Jawaid Bazyar and Dave
>Lyons appear to have a handle on what I want to know, and I would
>appreciate a response from either of you.

  Hey, there ya go! :-)

-- 
 Jawaid Bazyar              |   Ask me about the GNO Multitasking Environment
 Procyon, Inc.              |   for the Apple IIgs!   
 bazyar@cs.uiuc.edu         |   P.O Box 620334
 --Apple II Forever!--      |   Littleton, CO 80162-0334   (303) 933-4649